From ad0b4f873e99e81e2393bebd11d1e0ad259a03f1 Mon Sep 17 00:00:00 2001 From: Anders Sandstrom Date: Thu, 18 Mar 2021 10:10:48 +0100 Subject: [PATCH] Cleanup in asub --- .../src/ecmcByteToArrayAsub.cpp | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcByteToArrayAsub.cpp b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcByteToArrayAsub.cpp index 2665dd2..541ea5e 100644 --- a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcByteToArrayAsub.cpp +++ b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcByteToArrayAsub.cpp @@ -1,3 +1,21 @@ +/*************************************************************************\ +* Copyright (c) 2019 European Spallation Source ERIC +* ecmc is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +* +* ecmcByteToArrayAsub.cpp +* +* Created on: Mar 18, 2021 +* Author: anderssandstrom +* +* Usage: +* 1. Link bytes to inputs A..S. +* 2. Link array to VALA. +* 3. Set size of output in NOVA. This also defines how many inputs will be used. +* Note: Max 18 bytes (input A..S) will be merged into the array. +* +\*************************************************************************/ + // aSub, EPICS related headers #include #include @@ -18,17 +36,18 @@ epicsRegisterFunction(ecmcByteToArray); // init (INAM) static long ecmcByteToArrayInit(struct aSubRecord *rec){ + epicsUInt8 byteCount=(epicsUInt8)rec->nova; std::cout << "ecmcByteToArrayInit aSubRecord: "<< rec->name << std::endl; - printf("ecmcByteToArray aSubRecord: %d\n",rec->noa); + printf("ecmcByteToArray: Bytes to me merged %d\n",(int)byteCount); return 0; } static long ecmcByteToArray(struct aSubRecord *rec){ - printf("EXECUTING!!!!!\n"); - // input A must be size of output array + epicsUInt8 byteCount=(epicsUInt8)rec->nova; + //printf("ecmcByteToArray: Meging %d bytes to an array.\n",(int)byteCount); // Max 18 byte in a row if(byteCount <=0 || byteCount>18){ printf("WARNING: Only 18 first bytes will be transferred to output.\n");