epics-modules / measComp

EPICS support for some USB and Ethernet I/O modules from Measurement Computing
6 stars 16 forks source link

TC-32 returns error message for ERR_BAD_PORT_TYPE #28

Closed jeonghanlee closed 1 year ago

jeonghanlee commented 1 year ago

@MarkRivers I see the following ERROR message within the IOC console with TC-32. How could I debug them? Reading the temperature value from all channels seems fine since my database file only contains the TemperatureIn template.

MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified

Best, @jeonghanlee

MarkRivers commented 1 year ago

This is a new commit today and only tested on a few models.

jeonghanlee commented 1 year ago

Thank you for the hint, which I will try and let you know.

MarkRivers commented 1 year ago

I just deleted my comment about the TC-32 not having any digital I/O ports. That is not correct. It actually has 8 digital inputs and 32 digital outputs.

I think I may understand the problem. The 32 digital outputs are write-only ports. It may generate an error when attempting to read those ports, which the poller() function was doing. The TC-32 is the only model I know of that has write-only ports, which may be why we have not seen this problem before.

I have just pushed a new version of drvMultifunction to the master branch on Github. This version determines whether an IO port is write-only and does not attempt to read it if it is.

@jeonghanlee please try the latest master branch. Type the following command at the IOC prompt and post the output:

asynReport 1
jeonghanlee commented 1 year ago

asyReport(1) returns the following

Port: TCMD1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 3
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port mask         = 0xff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts = 

I added the debugging printf in drvMultiFunction.cpp


  1009     status = ulAIGetInfo(daqDeviceHandle_, AI_INFO_RESOLUTION, 0, &infoValue);
  1010     ADCResolution_ = infoValue;
  1011     printf(">>>>>>>>>>>>>>>>>>>>>>> ADC resolution infoValue %d with %d\n", infoValue, status);
  1012     status = ulAOGetInfo(daqDeviceHandle_, AO_INFO_RESOLUTION, 0, &infoValue);
  1013     DACResolution_ = infoValue;
  1014     printf(">>>>>>>>>>>>>>>>>>>>>>> DAC resolution infoValue %d with %d\n", infoValue, status);
  1015     status = ulDIOGetInfo(daqDeviceHandle_, DIO_INFO_NUM_PORTS, 0, &infoValue);
  1016     numIOPorts_ = infoValue;
  1017     printf(">>>>>>>>>>>>>>>>>>>>>>> numIOPorts infoValue %d with %d\n", infoValue, status);
  1018     status = ulAIGetInfo(daqDeviceHandle_, AI_INFO_NUM_CHANS_BY_TYPE, AI_TC, &infoValue);
  1019     numTempChans_ = infoValue;
  1020     printf(">>>>>>>>>>>>>>>>>>>>>>> numTempChans infoValue %d with %d\n", infoValue, status);

I can see in the ioc console.

>>>>>>>>>>>>>>>>>>>>>>> ADC resolution infoValue 24 with 0
>>>>>>>>>>>>>>>>>>>>>>> DAC resolution infoValue 24 with 3
>>>>>>>>>>>>>>>>>>>>>>> numIOPorts infoValue 4 with 0
>>>>>>>>>>>>>>>>>>>>>>> numTempChans infoValue 64 with 0

I am delving their codes more, and let you know what I see.

MarkRivers commented 1 year ago

I had forgotten to push my changes to Github. Please download and test again. You will see additional output in the asynReport with the state of the ReadOnly and WriteOnly properties of each port.

jeonghanlee commented 1 year ago

@MarkRivers

 Port: TCMD1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 3
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts = 
MarkRivers commented 1 year ago

Do you still get the error messages in the poller?

The output above shows that none of the ports are "write only", just that ports 0 and 2 are read only. I don't understand why we are getting the error reading the port.

I have add some additional debugging in the poller() function. Please load the new master and test again.

Please post the complete output when the IOC boots and runs for a few seconds.

jeonghanlee commented 1 year ago

Yes, I still have the error message.

ioctest-tcmd (master)$ ./st.cmd
#!../../bin/linux-x86_64/tcmd
< envPaths
epicsEnvSet("IOC","ioctest-tcmd")
epicsEnvSet("TOP","/home/jeonglee/gitsrc/tcmd")
epicsEnvSet("MODULES","/home/jeonglee/epics/debian-11/7.0.7/base/../modules")
epicsEnvSet("ASYN","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/asyn")
epicsEnvSet("SNCSEQ","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/seq")
epicsEnvSet("STD","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/std")
epicsEnvSet("CALC","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/calc")
epicsEnvSet("AUTOSAVE","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/autosave")
epicsEnvSet("RECCASTER","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/recsync")
epicsEnvSet("RETOOLS","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/retools")
epicsEnvSet("CAPUTLOG","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/caPutLog")
epicsEnvSet("devIocStats","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/iocStats")
epicsEnvSet("MEASCOMP","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/measComp")
epicsEnvSet("SSCAN","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/sscan")
epicsEnvSet("BUSY","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/busy")
epicsEnvSet("SCALER","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/scaler")
epicsEnvSet("MCA","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/mca")
epicsEnvSet("EPICS_BASE","/home/jeonglee/epics/debian-11/7.0.7/base")
cd "/home/jeonglee/gitsrc/tcmd"
epicsEnvSet("DB_TOP",               "/home/jeonglee/gitsrc/tcmd/db")
epicsEnvSet("IOCSH_LOCAL_TOP",      "/home/jeonglee/gitsrc/tcmd/iocsh")
epicsEnvSet("IOCSH_TOP",            "/home/jeonglee/epics/debian-11/7.0.7/base/../modules/iocsh/iocsh")
epicsEnvSet("ENGINEER",  "jeonglee")
epicsEnvSet("LOCATION",  "B46-182")
epicsEnvSet("WIKI", "")
epicsEnvSet("IOCNAME", "test-tcmd")
epicsEnvSet("IOC", "ioctest-tcmd")
epicsEnvSet("P1", "B46-182:E-TC1:")
epicsEnvSet("P2", "B46-182:E-TC2:")
epicsEnvSet("P3", "B46-182:TC32-1:")
dbLoadDatabase "dbd/tcmd.dbd"
tcmd_registerRecordDeviceDriver pdbbase
cd "/home/jeonglee/gitsrc/tcmd/iocBoot/ioctest-tcmd"
epicsEnvSet("PORT3",      "TCMD1")
epicsEnvSet("PORT3_IP",   "xxx.xxx.xxx.xxx")
iocshLoad("/home/jeonglee/gitsrc/tcmd/iocsh/tcmd.iocsh", "P=B46-182:TC32-1:,SHOWDEV=,DATABASE_TOP=/home/jeonglee/gitsrc/tcmd/db,DATABASE_NAME=TC32-alsu.db,PORT=TCMD1,IPADDR=xxx.xxx.xxx.xxx")
####################################################################################################
################# START of tcmd.iocsh ##############################################################
MultiFunctionConfig("TCMD1", "xxx.xxx.xxx.xxx", 1, 1)
 measCompShowDevices()
measCompShowDevices, numDevices=1
Device 0
    ProductName: TC32
      ProductID: 306
  InterfaceType: 4
      DevString: TC-32-34CB8F
       UniqueID: xxxxxxxxxxxx
       Reserved:
dbLoadRecords("/home/jeonglee/gitsrc/tcmd/db/TC32-alsu.db", "P=B46-182:TC32-1:,PORT=TCMD1,SCAN=1 second,PREC=3")
2023/04/22 01:45:55.687 MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified
port number=2, port type=14
################# END of tcmd.iocsh ################################################################
####################################################################################################
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.7-github.com/jeonghanlee/EPICS-env
## Rev. R7.0.7-dirty
## Rev. Date Git: 2022-09-07 13:50:35 -0500
############################################################################
iocRun: All initialization complete
epicsEnvShow > /vxboot/PVenv/ioctest-tcmd.softioc
dbl > /vxboot/PVnames/ioctest-tcmd

7.0.7 > asynReport 1
TCMD1 multiDevice:Yes canBlock:Yes autoConnect:Yes
    enabled:Yes connected:Yes numberConnects 1
    nDevices 32 nQueued 0 blocked:No
    asynManagerLock:No synchronousLock:No
    exceptionActive:No exceptionUsers 0 exceptionNotifys 0
    traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 1 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 2 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 3 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 4 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 5 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 6 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 7 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 8 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 9 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 10 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 11 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 12 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 13 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 14 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 15 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 16 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 17 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 18 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 19 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 20 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 21 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 22 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 23 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 24 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 25 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 26 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 27 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 28 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 29 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 30 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 31 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
Port: TCMD1
  Timestamp: <undefined>
  Input EOS[0]:
  Output EOS[0]:
Parameter list 0
Number of parameters is: 81
Parameter 0 type=string, name=MODEL_NAME, value=TC32, status=0
Parameter 1 type=asynInt32, name=MODEL_NUMBER, value=306, status=0
Parameter 2 type=string, name=FIRMWARE_VERSION, value=1.08, status=0
Parameter 3 type=string, name=UNIQUE_ID, value=128.3.130.203, status=0
Parameter 4 type=string, name=UL_VERSION, value=1.2.0, status=0
Parameter 5 type=string, name=DRIVER_VERSION, value=4.2, status=0
Parameter 6 type=asynFloat64, name=POLL_SLEEP_MS, value is undefined
Parameter 7 type=asynFloat64, name=POLL_TIME_MS, value is undefined
Parameter 8 type=string, name=LAST_ERROR_MESSAGE, value is undefined
Parameter 9 type=asynInt32, name=PULSE_RUN, value=0, status=0
Parameter 10 type=asynFloat64, name=PULSE_PERIOD, value is undefined
Parameter 11 type=asynFloat64, name=PULSE_WIDTH, value is undefined
Parameter 12 type=asynFloat64, name=PULSE_DELAY, value is undefined
Parameter 13 type=asynInt32, name=PULSE_COUNT, value is undefined
Parameter 14 type=asynInt32, name=PULSE_IDLE_STATE, value is undefined
Parameter 15 type=asynInt32, name=COUNTER_VALUE, value is undefined
Parameter 16 type=asynInt32, name=COUNTER_RESET, value is undefined
Parameter 17 type=asynInt32, name=ANALOG_IN_VALUE, value is undefined
Parameter 18 type=asynInt32, name=ANALOG_IN_RANGE, value is undefined
Parameter 19 type=asynInt32, name=ANALOG_IN_TYPE, value=2, status=0
Parameter 20 type=asynInt32, name=ANALOG_IN_MODE, value is undefined
Parameter 21 type=asynInt32, name=ANALOG_IN_RATE, value is undefined
Parameter 22 type=asynFloat64, name=VOLTAGE_IN_VALUE, value is undefined
Parameter 23 type=asynInt32, name=VOLTAGE_IN_RANGE, value is undefined
Parameter 24 type=asynFloat64, name=TEMPERATURE_IN_VALUE, value=20.6274, status=0
Parameter 25 type=asynInt32, name=THERMOCOUPLE_TYPE, value=1, status=0
Parameter 26 type=asynInt32, name=THERMOCOUPLE_OPEN_DETECT, value is undefined
Parameter 27 type=asynInt32, name=TEMPERATURE_SCALE, value=0, status=0
Parameter 28 type=asynInt32, name=TEMPERATURE_FILTER, value=0, status=0
Parameter 29 type=asynInt32, name=TEMPERATURE_SENSOR, value is undefined
Parameter 30 type=asynInt32, name=TEMPERATURE_WIRING, value is undefined
Parameter 31 type=asynFloat64, name=WAVEDIG_DWELL, value is undefined
Parameter 32 type=asynFloat64, name=WAVEDIG_DWELL_ACTUAL, value is undefined
Parameter 33 type=asynFloat64, name=WAVEDIG_TOTAL_TIME, value is undefined
Parameter 34 type=asynInt32, name=WAVEDIG_FIRST_CHAN, value is undefined
Parameter 35 type=asynInt32, name=WAVEDIG_NUM_CHANS, value is undefined
Parameter 36 type=asynInt32, name=WAVEDIG_NUM_POINTS, value=1, status=0
Parameter 37 type=asynInt32, name=WAVEDIG_CURRENT_POINT, value is undefined
Parameter 38 type=asynInt32, name=WAVEDIG_EXT_TRIGGER, value is undefined
Parameter 39 type=asynInt32, name=WAVEDIG_EXT_CLOCK, value is undefined
Parameter 40 type=asynInt32, name=WAVEDIG_CONTINUOUS, value is undefined
Parameter 41 type=asynInt32, name=WAVEDIG_AUTO_RESTART, value is undefined
Parameter 42 type=asynInt32, name=WAVEDIG_RETRIGGER, value is undefined
Parameter 43 type=asynInt32, name=WAVEDIG_TRIGGER_COUNT, value is undefined
Parameter 44 type=asynInt32, name=WAVEDIG_BURST_MODE, value is undefined
Parameter 45 type=asynInt32, name=WAVEDIG_RUN, value=0, status=0
Parameter 46 type=asynFloat32Array, name=WAVEDIG_TIME_WF, value is undefined
Parameter 47 type=asynFloat64Array, name=WAVEDIG_ABS_TIME_WF, value is undefined
Parameter 48 type=asynInt32, name=WAVEDIG_READ_WF, value is undefined
Parameter 49 type=asynFloat32Array, name=WAVEDIG_VOLT_WF, value is undefined
Parameter 50 type=asynInt32, name=ANALOG_OUT_VALUE, value is undefined
Parameter 51 type=asynInt32, name=ANALOG_OUT_RANGE, value=0, status=0
Parameter 52 type=asynFloat64, name=WAVEGEN_FREQ, value is undefined
Parameter 53 type=asynFloat64, name=WAVEGEN_DWELL, value is undefined
Parameter 54 type=asynFloat64, name=WAVEGEN_DWELL_ACTUAL, value is undefined
Parameter 55 type=asynFloat64, name=WAVEGEN_TOTAL_TIME, value is undefined
Parameter 56 type=asynInt32, name=WAVEGEN_NUM_POINTS, value is undefined
Parameter 57 type=asynInt32, name=WAVEGEN_CURRENT_POINT, value is undefined
Parameter 58 type=asynFloat64, name=WAVEGEN_INT_DWELL, value is undefined
Parameter 59 type=asynFloat64, name=WAVEGEN_USER_DWELL, value is undefined
Parameter 60 type=asynInt32, name=WAVEGEN_INT_NUM_POINTS, value=1, status=0
Parameter 61 type=asynInt32, name=WAVEGEN_USER_NUM_POINTS, value=1, status=0
Parameter 62 type=asynInt32, name=WAVEGEN_EXT_TRIGGER, value is undefined
Parameter 63 type=asynInt32, name=WAVEGEN_EXT_CLOCK, value is undefined
Parameter 64 type=asynInt32, name=WAVEGEN_CONTINUOUS, value is undefined
Parameter 65 type=asynInt32, name=WAVEGEN_RETRIGGER, value is undefined
Parameter 66 type=asynInt32, name=WAVEGEN_TRIGGER_COUNT, value is undefined
Parameter 67 type=asynInt32, name=WAVEGEN_RUN, value=0, status=0
Parameter 68 type=asynFloat32Array, name=WAVEGEN_USER_TIME_WF, value is undefined
Parameter 69 type=asynFloat32Array, name=WAVEGEN_INT_TIME_WF, value is undefined
Parameter 70 type=asynInt32, name=WAVEGEN_WAVE_TYPE, value is undefined
Parameter 71 type=asynInt32, name=WAVEGEN_ENABLE, value is undefined
Parameter 72 type=asynFloat64, name=WAVEGEN_AMPLITUDE, value is undefined
Parameter 73 type=asynFloat64, name=WAVEGEN_OFFSET, value is undefined
Parameter 74 type=asynFloat64, name=WAVEGEN_PULSE_WIDTH, value is undefined
Parameter 75 type=asynFloat32Array, name=WAVEGEN_INT_WF, value is undefined
Parameter 76 type=asynFloat32Array, name=WAVEGEN_USER_WF, value is undefined
Parameter 77 type=asynInt32, name=TRIGGER_MODE, value is undefined
Parameter 78 type=asynUInt32Digital, name=DIGITAL_DIRECTION, value=0x0, status=0, risingMask=0x0, fallingMask=0x0, callbackMask=0x0
Parameter 79 type=asynUInt32Digital, name=DIGITAL_INPUT, value=0xff, status=0, risingMask=0x7f38, fallingMask=0x8cc78be0, callbackMask=0x0
Parameter 80 type=asynUInt32Digital, name=DIGITAL_OUTPUT, value is undefined
  Port: TCMD1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 3
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts =
7.0.7 >
jeonghanlee commented 1 year ago

@MarkRivers, I've found where that error is introduced. That is the following.

https://github.com/epics-modules/measComp/blob/66e0e8ae1e07f7642cbe5e591b9305c1cae9cd85/measCompApp/src/drvMultiFunction.cpp#L208

From https://github.com/epics-modules/measComp/commit/e225ef9832177a7b1bc3466bad41ddf204dbebbf, you changed it to 3 due to DIO24.

In short, if I changed this number to 2, I don't see the error message.

MultiFunctionConfig("TCMD1", "128.3.130.203", 1, 1)
 measCompShowDevices()
measCompShowDevices, numDevices=1
Device 0
    ProductName: TC32
      ProductID: 306
  InterfaceType: 4
      DevString: TC-32-34CB8F
       UniqueID: 00:80:2F:34:CB:8F
       Reserved:
dbLoadRecords("/home/jeonglee/gitsrc/tcmd/db/TC32-alsu.db", "P=B46-182:TC32-1:,PORT=TCMD1,SCAN=1 second,PREC=3")
################# END of tcmd.iocsh ################################################################
MarkRivers commented 1 year ago

This additional debugging shows the problem is with the third DIO port (number 2 starting at 0):

2023/04/22 01:45:55.687 MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified
port number=2, port type=14

That port describes itself as an input-only port, so I don't understand why it is generating an error when we read it.

I have increased MAX_IO_PORTS to 8, just to be safe with future devices. I have also added additional debugging in the constructor so that I have the information I need to send to Measurement Computing technical support when I report this issue. Please test the master branch again and post the output again when it starts up.

Do you have the expansion unit installed on your TC-32 system? I think you probably do because the documentation says that the base TC-32 has only 2 IO ports, but the expansion unit adds 2 more. So I suspect we will now see 4 ports total now that I have increased MAX_IO_PORTS to 8.

jeonghanlee commented 1 year ago

@MarkRivers, here are the latest asynReport 1 outputs:

  Port: TCMD1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 4
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     3
    I/O port              = 15
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts =

I still see the error message.

I don't use the expansion unit, and my guess now measComp defined everything in their TC-32 main unit to cover their expansion board as well, even if we don't use the expansion board, since their "returned" value is clearly "4" in 1015 status = ulDIOGetInfo(daqDeviceHandle_, DIO_INFO_NUM_PORTS, 0, &infoValue); Four digital I/O ports may explain that the TC-32 and TC-32 expansion board configuration is hard code in the TC-32 unit alone.

In the previous commit, which has MAX_IO_PORTS was 3, I only saw three IOs because of the following line. And I need help understanding the following line as well.

https://github.com/epics-modules/measComp/blob/f21b8664b383dc9b730dea72d220957f3bc3cfd7/measCompApp/src/drvMultiFunction.cpp#L1020

By the way, I can ship one unit to you if you want to test it in your location. The unit has multiple issues (more than this error message). And I want to fix them one by one.

MarkRivers commented 1 year ago

Please post the complete output when the IOC starts up and generates a few error messages. That will tell me exactly what the queries are returning. You can do that by copying to a text file, and attaching the text file, rather than pasting in-line.

And I need help understanding the following line as well.

measComp/measCompApp/src/drvMultiFunction.cpp

That line is intended to prevent array bounds problems. There are arrays that are dimensioned [MAX_IOPORTS], and if numIOPorts is allowed to be larger than that value then there will be array bounds violations.

There are TC-32 units at the APS that I will borrow to test. The APS beam just shut off for a year, so those units should be free to borrow.

jeonghanlee commented 1 year ago

Here is the full output.

ioctest-tcmd (master)$ ./st.cmd
#!../../bin/linux-x86_64/tcmd
< envPaths
epicsEnvSet("IOC","ioctest-tcmd")
epicsEnvSet("TOP","/home/jeonglee/gitsrc/tcmd")
epicsEnvSet("MODULES","/home/jeonglee/epics/debian-11/7.0.7/base/../modules")
epicsEnvSet("ASYN","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/asyn")
epicsEnvSet("SNCSEQ","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/seq")
epicsEnvSet("STD","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/std")
epicsEnvSet("CALC","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/calc")
epicsEnvSet("AUTOSAVE","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/autosave")
epicsEnvSet("RECCASTER","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/recsync")
epicsEnvSet("RETOOLS","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/retools")
epicsEnvSet("CAPUTLOG","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/caPutLog")
epicsEnvSet("devIocStats","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/iocStats")
epicsEnvSet("MEASCOMP","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/measComp")
epicsEnvSet("SSCAN","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/sscan")
epicsEnvSet("BUSY","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/busy")
epicsEnvSet("SCALER","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/scaler")
epicsEnvSet("MCA","/home/jeonglee/epics/debian-11/7.0.7/base/../modules/mca")
epicsEnvSet("EPICS_BASE","/home/jeonglee/epics/debian-11/7.0.7/base")
cd "/home/jeonglee/gitsrc/tcmd"
epicsEnvSet("DB_TOP",         "/home/jeonglee/gitsrc/tcmd/db")
epicsEnvSet("IOCSH_LOCAL_TOP","/home/jeonglee/gitsrc/tcmd/iocsh")
epicsEnvSet("IOCSH_TOP",      "/home/jeonglee/epics/debian-11/7.0.7/base/../modules/iocsh/iocsh")
epicsEnvSet("ENGINEER",  "jeonglee")
epicsEnvSet("LOCATION",  "B46-182")
epicsEnvSet("WIKI", "")
epicsEnvSet("IOCNAME", "test-tcmd")
epicsEnvSet("IOC", "ioctest-tcmd")
epicsEnvSet("P1", "B46-182:E-TC1:")
epicsEnvSet("P2", "B46-182:E-TC2:")
epicsEnvSet("P3", "B46-182:TC32-1:")
dbLoadDatabase "dbd/tcmd.dbd"
tcmd_registerRecordDeviceDriver pdbbase
cd "/home/jeonglee/gitsrc/tcmd/iocBoot/ioctest-tcmd"
epicsEnvSet("PORT3",      "TCMD1")
epicsEnvSet("PORT3_IP",   "xxx.xxx.xxx.xxx")
iocshLoad("/home/jeonglee/gitsrc/tcmd/iocsh/tcmd.iocsh", "P=B46-182:TC32-1:,SHOWDEV=,DATABASE_TOP=/home/jeonglee/gitsrc/tcmd/db,DATABASE_NAME=TC32-alsu.db,PORT=TCMD1,IPADDR=xxx.xxx.xxx.xxx")
##############################################################
################# START of tcmd.iocsh ##############################################################
MultiFunctionConfig("TCMD1", "xxx.xxx.xxx.xxx", 1, 1)
IOPort=0 DIO_INFO_PORT_TYPE=10, DIO_INFO_PORT_IO_TYPE=1
IOPort=1 DIO_INFO_PORT_TYPE=11, DIO_INFO_PORT_IO_TYPE=5
IOPort=2 DIO_INFO_PORT_TYPE=14, DIO_INFO_PORT_IO_TYPE=1
IOPort=3 DIO_INFO_PORT_TYPE=15, DIO_INFO_PORT_IO_TYPE=5
 measCompShowDevices()
measCompShowDevices, numDevices=1
Device 0
    ProductName: TC32
    ProductID: 306
  InterfaceType: 4
    DevString: TC-32-34CB8F
    UniqueID: XX:XX:XX:XX:XX:XX
    Reserved:
dbLoadRecords("/home/jeonglee/gitsrc/tcmd/db/TC32-alsu.db", "P=B46-182:TC32-1:,PORT=TCMD1,SCAN=1 second,PREC=3")
2023/04/24 09:10:36.068 MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified
port number=2, port type=14
################# END of tcmd.iocsh ################################################################
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.7-github.com/jeonghanlee/EPICS-env
## Rev. R7.0.7-dirty
## Rev. Date Git: 2022-09-07 13:50:35 -0500
############################################################################
iocRun: All initialization complete
epicsEnvShow > /vxboot/PVenv/ioctest-tcmd.softioc
dbl > /vxboot/PVnames/ioctest-tcmd

7.0.7 > asynReport 1
TCMD1 multiDevice:Yes canBlock:Yes autoConnect:Yes
    enabled:Yes connected:Yes numberConnects 1
    nDevices 32 nQueued 0 blocked:No
    asynManagerLock:No synchronousLock:No
    exceptionActive:No exceptionUsers 0 exceptionNotifys 0
    traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 1 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 2 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 3 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 4 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 5 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 6 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 7 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 8 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 9 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 10 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 11 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 12 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 13 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 14 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 15 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 16 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 17 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 18 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 19 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 20 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 21 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 22 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 23 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 24 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 25 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 26 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 27 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 28 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 29 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 30 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 31 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 0 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
Port: TCMD1
  Timestamp: <undefined>
  Input EOS[0]:
  Output EOS[0]:
Parameter list 0
Number of parameters is: 81
Parameter 0 type=string, name=MODEL_NAME, value=TC32, status=0
Parameter 1 type=asynInt32, name=MODEL_NUMBER, value=306, status=0
Parameter 2 type=string, name=FIRMWARE_VERSION, value=1.08, status=0
Parameter 3 type=string, name=UNIQUE_ID, value=xxx.xxx.xxx.xxx, status=0
Parameter 4 type=string, name=UL_VERSION, value=1.2.0, status=0
Parameter 5 type=string, name=DRIVER_VERSION, value=4.2, status=0
Parameter 6 type=asynFloat64, name=POLL_SLEEP_MS, value is undefined
Parameter 7 type=asynFloat64, name=POLL_TIME_MS, value is undefined
Parameter 8 type=string, name=LAST_ERROR_MESSAGE, value is undefined
Parameter 9 type=asynInt32, name=PULSE_RUN, value=0, status=0
Parameter 10 type=asynFloat64, name=PULSE_PERIOD, value is undefined
Parameter 11 type=asynFloat64, name=PULSE_WIDTH, value is undefined
Parameter 12 type=asynFloat64, name=PULSE_DELAY, value is undefined
Parameter 13 type=asynInt32, name=PULSE_COUNT, value is undefined
Parameter 14 type=asynInt32, name=PULSE_IDLE_STATE, value is undefined
Parameter 15 type=asynInt32, name=COUNTER_VALUE, value is undefined
Parameter 16 type=asynInt32, name=COUNTER_RESET, value is undefined
Parameter 17 type=asynInt32, name=ANALOG_IN_VALUE, value is undefined
Parameter 18 type=asynInt32, name=ANALOG_IN_RANGE, value is undefined
Parameter 19 type=asynInt32, name=ANALOG_IN_TYPE, value=2, status=0
Parameter 20 type=asynInt32, name=ANALOG_IN_MODE, value is undefined
Parameter 21 type=asynInt32, name=ANALOG_IN_RATE, value is undefined
Parameter 22 type=asynFloat64, name=VOLTAGE_IN_VALUE, value is undefined
Parameter 23 type=asynInt32, name=VOLTAGE_IN_RANGE, value is undefined
Parameter 24 type=asynFloat64, name=TEMPERATURE_IN_VALUE, value=19.2827, status=0
Parameter 25 type=asynInt32, name=THERMOCOUPLE_TYPE, value=1, status=0
Parameter 26 type=asynInt32, name=THERMOCOUPLE_OPEN_DETECT, value is undefined
Parameter 27 type=asynInt32, name=TEMPERATURE_SCALE, value=0, status=0
Parameter 28 type=asynInt32, name=TEMPERATURE_FILTER, value=0, status=0
Parameter 29 type=asynInt32, name=TEMPERATURE_SENSOR, value is undefined
Parameter 30 type=asynInt32, name=TEMPERATURE_WIRING, value is undefined
Parameter 31 type=asynFloat64, name=WAVEDIG_DWELL, value is undefined
Parameter 32 type=asynFloat64, name=WAVEDIG_DWELL_ACTUAL, value is undefined
Parameter 33 type=asynFloat64, name=WAVEDIG_TOTAL_TIME, value is undefined
Parameter 34 type=asynInt32, name=WAVEDIG_FIRST_CHAN, value is undefined
Parameter 35 type=asynInt32, name=WAVEDIG_NUM_CHANS, value is undefined
Parameter 36 type=asynInt32, name=WAVEDIG_NUM_POINTS, value=1, status=0
Parameter 37 type=asynInt32, name=WAVEDIG_CURRENT_POINT, value is undefined
Parameter 38 type=asynInt32, name=WAVEDIG_EXT_TRIGGER, value is undefined
Parameter 39 type=asynInt32, name=WAVEDIG_EXT_CLOCK, value is undefined
Parameter 40 type=asynInt32, name=WAVEDIG_CONTINUOUS, value is undefined
Parameter 41 type=asynInt32, name=WAVEDIG_AUTO_RESTART, value is undefined
Parameter 42 type=asynInt32, name=WAVEDIG_RETRIGGER, value is undefined
Parameter 43 type=asynInt32, name=WAVEDIG_TRIGGER_COUNT, value is undefined
Parameter 44 type=asynInt32, name=WAVEDIG_BURST_MODE, value is undefined
Parameter 45 type=asynInt32, name=WAVEDIG_RUN, value=0, status=0
Parameter 46 type=asynFloat32Array, name=WAVEDIG_TIME_WF, value is undefined
Parameter 47 type=asynFloat64Array, name=WAVEDIG_ABS_TIME_WF, value is undefined
Parameter 48 type=asynInt32, name=WAVEDIG_READ_WF, value is undefined
Parameter 49 type=asynFloat32Array, name=WAVEDIG_VOLT_WF, value is undefined
Parameter 50 type=asynInt32, name=ANALOG_OUT_VALUE, value is undefined
Parameter 51 type=asynInt32, name=ANALOG_OUT_RANGE, value=0, status=0
Parameter 52 type=asynFloat64, name=WAVEGEN_FREQ, value is undefined
Parameter 53 type=asynFloat64, name=WAVEGEN_DWELL, value is undefined
Parameter 54 type=asynFloat64, name=WAVEGEN_DWELL_ACTUAL, value is undefined
Parameter 55 type=asynFloat64, name=WAVEGEN_TOTAL_TIME, value is undefined
Parameter 56 type=asynInt32, name=WAVEGEN_NUM_POINTS, value is undefined
Parameter 57 type=asynInt32, name=WAVEGEN_CURRENT_POINT, value is undefined
Parameter 58 type=asynFloat64, name=WAVEGEN_INT_DWELL, value is undefined
Parameter 59 type=asynFloat64, name=WAVEGEN_USER_DWELL, value is undefined
Parameter 60 type=asynInt32, name=WAVEGEN_INT_NUM_POINTS, value=1, status=0
Parameter 61 type=asynInt32, name=WAVEGEN_USER_NUM_POINTS, value=1, status=0
Parameter 62 type=asynInt32, name=WAVEGEN_EXT_TRIGGER, value is undefined
Parameter 63 type=asynInt32, name=WAVEGEN_EXT_CLOCK, value is undefined
Parameter 64 type=asynInt32, name=WAVEGEN_CONTINUOUS, value is undefined
Parameter 65 type=asynInt32, name=WAVEGEN_RETRIGGER, value is undefined
Parameter 66 type=asynInt32, name=WAVEGEN_TRIGGER_COUNT, value is undefined
Parameter 67 type=asynInt32, name=WAVEGEN_RUN, value=0, status=0
Parameter 68 type=asynFloat32Array, name=WAVEGEN_USER_TIME_WF, value is undefined
Parameter 69 type=asynFloat32Array, name=WAVEGEN_INT_TIME_WF, value is undefined
Parameter 70 type=asynInt32, name=WAVEGEN_WAVE_TYPE, value is undefined
Parameter 71 type=asynInt32, name=WAVEGEN_ENABLE, value is undefined
Parameter 72 type=asynFloat64, name=WAVEGEN_AMPLITUDE, value is undefined
Parameter 73 type=asynFloat64, name=WAVEGEN_OFFSET, value is undefined
Parameter 74 type=asynFloat64, name=WAVEGEN_PULSE_WIDTH, value is undefined
Parameter 75 type=asynFloat32Array, name=WAVEGEN_INT_WF, value is undefined
Parameter 76 type=asynFloat32Array, name=WAVEGEN_USER_WF, value is undefined
Parameter 77 type=asynInt32, name=TRIGGER_MODE, value is undefined
Parameter 78 type=asynUInt32Digital, name=DIGITAL_DIRECTION, value=0x0, status=0, risingMask=0x0, fallingMask=0x0, callbackMask=0x0
Parameter 79 type=asynUInt32Digital, name=DIGITAL_INPUT, value=0xff, status=0, risingMask=0x7f49, fallingMask=0xdf480bc0, callbackMask=0x0
Parameter 80 type=asynUInt32Digital, name=DIGITAL_OUTPUT, value is undefined
  Port: TCMD1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 4
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     3
    I/O port              = 15
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts =
7.0.7 >
MarkRivers commented 1 year ago

@jeonghanlee I have borrowed a TC-32 and I tested on both Windows and Linux. The problem with an error polling the DIO ports does not occur on Windows because it only reports finding 2 DIO ports. I have pushed some minor changes to the driver to change the diagnostic I/O.

This is what asynReport 1 shows on Windows:

Port: TC32_1
  Timestamp: <undefined>
  Input EOS[0]:
  Output EOS[0]:
Parameter list 0
Number of parameters is: 81
Parameter 0 type=string, name=MODEL_NAME, value=TC-32, status=0
Parameter 1 type=asynInt32, name=MODEL_NUMBER, value=306, status=0
Parameter 2 type=string, name=FIRMWARE_VERSION, value=1.08, status=0
Parameter 3 type=string, name=UNIQUE_ID, value=00:80:2F:34:37:B5, status=0
Parameter 4 type=string, name=UL_VERSION, value=5.000000 5.000000, status=0
Parameter 5 type=string, name=DRIVER_VERSION, value=4.2, status=0
Parameter 6 type=asynFloat64, name=POLL_SLEEP_MS, value is undefined
Parameter 7 type=asynFloat64, name=POLL_TIME_MS, value is undefined
Parameter 8 type=string, name=LAST_ERROR_MESSAGE, value is undefined
Parameter 9 type=asynInt32, name=PULSE_RUN, value=0, status=0
Parameter 10 type=asynFloat64, name=PULSE_PERIOD, value is undefined
Parameter 11 type=asynFloat64, name=PULSE_WIDTH, value is undefined
Parameter 12 type=asynFloat64, name=PULSE_DELAY, value is undefined
Parameter 13 type=asynInt32, name=PULSE_COUNT, value is undefined
Parameter 14 type=asynInt32, name=PULSE_IDLE_STATE, value is undefined
Parameter 15 type=asynInt32, name=COUNTER_VALUE, value is undefined
Parameter 16 type=asynInt32, name=COUNTER_RESET, value is undefined
Parameter 17 type=asynInt32, name=ANALOG_IN_VALUE, value is undefined
Parameter 18 type=asynInt32, name=ANALOG_IN_RANGE, value is undefined
Parameter 19 type=asynInt32, name=ANALOG_IN_TYPE, value=300, status=0
Parameter 20 type=asynInt32, name=ANALOG_IN_MODE, value is undefined
Parameter 21 type=asynInt32, name=ANALOG_IN_RATE, value is undefined
Parameter 22 type=asynFloat64, name=VOLTAGE_IN_VALUE, value is undefined
Parameter 23 type=asynInt32, name=VOLTAGE_IN_RANGE, value is undefined
Parameter 24 type=asynFloat64, name=TEMPERATURE_IN_VALUE, value=24.2848, status=0
Parameter 25 type=asynInt32, name=THERMOCOUPLE_TYPE, value=1, status=0
Parameter 26 type=asynInt32, name=THERMOCOUPLE_OPEN_DETECT, value=0, status=0
Parameter 27 type=asynInt32, name=TEMPERATURE_SCALE, value=0, status=0
Parameter 28 type=asynInt32, name=TEMPERATURE_FILTER, value=0, status=0
Parameter 29 type=asynInt32, name=TEMPERATURE_SENSOR, value is undefined
Parameter 30 type=asynInt32, name=TEMPERATURE_WIRING, value is undefined
Parameter 31 type=asynFloat64, name=WAVEDIG_DWELL, value is undefined
Parameter 32 type=asynFloat64, name=WAVEDIG_DWELL_ACTUAL, value is undefined
Parameter 33 type=asynFloat64, name=WAVEDIG_TOTAL_TIME, value is undefined
Parameter 34 type=asynInt32, name=WAVEDIG_FIRST_CHAN, value is undefined
Parameter 35 type=asynInt32, name=WAVEDIG_NUM_CHANS, value is undefined
Parameter 36 type=asynInt32, name=WAVEDIG_NUM_POINTS, value=1, status=0
Parameter 37 type=asynInt32, name=WAVEDIG_CURRENT_POINT, value is undefined
Parameter 38 type=asynInt32, name=WAVEDIG_EXT_TRIGGER, value is undefined
Parameter 39 type=asynInt32, name=WAVEDIG_EXT_CLOCK, value is undefined
Parameter 40 type=asynInt32, name=WAVEDIG_CONTINUOUS, value is undefined
Parameter 41 type=asynInt32, name=WAVEDIG_AUTO_RESTART, value is undefined
Parameter 42 type=asynInt32, name=WAVEDIG_RETRIGGER, value is undefined
Parameter 43 type=asynInt32, name=WAVEDIG_TRIGGER_COUNT, value is undefined
Parameter 44 type=asynInt32, name=WAVEDIG_BURST_MODE, value is undefined
Parameter 45 type=asynInt32, name=WAVEDIG_RUN, value=0, status=0
Parameter 46 type=asynFloat32Array, name=WAVEDIG_TIME_WF, value is undefined
Parameter 47 type=asynFloat64Array, name=WAVEDIG_ABS_TIME_WF, value is undefined
Parameter 48 type=asynInt32, name=WAVEDIG_READ_WF, value is undefined
Parameter 49 type=asynFloat32Array, name=WAVEDIG_VOLT_WF, value is undefined
Parameter 50 type=asynInt32, name=ANALOG_OUT_VALUE, value is undefined
Parameter 51 type=asynInt32, name=ANALOG_OUT_RANGE, value=0, status=0
Parameter 52 type=asynFloat64, name=WAVEGEN_FREQ, value is undefined
Parameter 53 type=asynFloat64, name=WAVEGEN_DWELL, value is undefined
Parameter 54 type=asynFloat64, name=WAVEGEN_DWELL_ACTUAL, value is undefined
Parameter 55 type=asynFloat64, name=WAVEGEN_TOTAL_TIME, value is undefined
Parameter 56 type=asynInt32, name=WAVEGEN_NUM_POINTS, value is undefined
Parameter 57 type=asynInt32, name=WAVEGEN_CURRENT_POINT, value is undefined
Parameter 58 type=asynFloat64, name=WAVEGEN_INT_DWELL, value is undefined
Parameter 59 type=asynFloat64, name=WAVEGEN_USER_DWELL, value is undefined
Parameter 60 type=asynInt32, name=WAVEGEN_INT_NUM_POINTS, value=1, status=0
Parameter 61 type=asynInt32, name=WAVEGEN_USER_NUM_POINTS, value=1, status=0
Parameter 62 type=asynInt32, name=WAVEGEN_EXT_TRIGGER, value is undefined
Parameter 63 type=asynInt32, name=WAVEGEN_EXT_CLOCK, value is undefined
Parameter 64 type=asynInt32, name=WAVEGEN_CONTINUOUS, value is undefined
Parameter 65 type=asynInt32, name=WAVEGEN_RETRIGGER, value is undefined
Parameter 66 type=asynInt32, name=WAVEGEN_TRIGGER_COUNT, value is undefined
Parameter 67 type=asynInt32, name=WAVEGEN_RUN, value=0, status=0
Parameter 68 type=asynFloat32Array, name=WAVEGEN_USER_TIME_WF, value is undefined
Parameter 69 type=asynFloat32Array, name=WAVEGEN_INT_TIME_WF, value is undefined
Parameter 70 type=asynInt32, name=WAVEGEN_WAVE_TYPE, value is undefined
Parameter 71 type=asynInt32, name=WAVEGEN_ENABLE, value is undefined
Parameter 72 type=asynFloat64, name=WAVEGEN_AMPLITUDE, value is undefined
Parameter 73 type=asynFloat64, name=WAVEGEN_OFFSET, value is undefined
Parameter 74 type=asynFloat64, name=WAVEGEN_PULSE_WIDTH, value is undefined
Parameter 75 type=asynFloat32Array, name=WAVEGEN_INT_WF, value is undefined
Parameter 76 type=asynFloat32Array, name=WAVEGEN_USER_WF, value is undefined
Parameter 77 type=asynInt32, name=TRIGGER_MODE, value is undefined
Parameter 78 type=asynUInt32Digital, name=DIGITAL_DIRECTION, value=0x0, status=0, risingMask=0x0, fallingMask=0x0, callbackMask=0x0
Parameter 79 type=asynUInt32Digital, name=DIGITAL_INPUT, value=0xff, status=0, risingMask=0x0, fallingMask=0x0, callbackMask=0x0
Parameter 80 type=asynUInt32Digital, name=DIGITAL_OUTPUT, value is undefined
  Port: TC32_1, board ID=306, board type=TC-32
  analog inputs      = 0
  analog input bits  = 0
  analog outputs     = 0
  analog output bits = 0
  temperature inputs = 32
  digital I/O ports  = 2
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 1
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 1
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 1
    I/O port mask         = 0xffffffff
  timers             = 0
  # counters         = 0  first counter      = -811833376  counterCounts =

Note that the first few parameters in the parameter list now include the model number (306) and firmware version (1.08). The number of digital I/O ports is reported as 2, which is correct.

This is what I see on Linux when the constructor is run:

MultiFunctionConfig("TC32_1", "164.54.160.221", 1, 1)
IOPort=0 DIO_INFO_PORT_TYPE=10, DIO_INFO_PORT_IO_TYPE=1
IOPort=1 DIO_INFO_PORT_TYPE=11, DIO_INFO_PORT_IO_TYPE=5
IOPort=2 DIO_INFO_PORT_TYPE=14, DIO_INFO_PORT_IO_TYPE=1
IOPort=3 DIO_INFO_PORT_TYPE=15, DIO_INFO_PORT_IO_TYPE=5
#asynSetTraceMask($(PORT), -1, ERROR|FLOW|DRIVER)
dbLoadTemplate("/corvette/home/epics/devel/measComp-4-0/db/TC32.substitutions", "P=TC32:,PORT=TC32_1")
2023/04/26 15:52:00.027 MultiFunction::pollerThread Error: Calling DIn, err=50 Invalid port type specified
2023/04/26 15:52:00.027 portNumber=2

This is the output from asynReport 1 on Linux:

Port: TC32_1
  Timestamp: <undefined>
  Input EOS[0]:
  Output EOS[0]:
Parameter list 0
Number of parameters is: 81
Parameter 0 type=string, name=MODEL_NAME, value=TC32, status=0
Parameter 1 type=asynInt32, name=MODEL_NUMBER, value=306, status=0
Parameter 2 type=string, name=FIRMWARE_VERSION, value=1.08, status=0
Parameter 3 type=string, name=UNIQUE_ID, value=164.54.160.221, status=0
Parameter 4 type=string, name=UL_VERSION, value=1.2.0, status=0
Parameter 5 type=string, name=DRIVER_VERSION, value=4.2, status=0
Parameter 6 type=asynFloat64, name=POLL_SLEEP_MS, value is undefined
Parameter 7 type=asynFloat64, name=POLL_TIME_MS, value is undefined
Parameter 8 type=string, name=LAST_ERROR_MESSAGE, value is undefined
Parameter 9 type=asynInt32, name=PULSE_RUN, value=0, status=0
Parameter 10 type=asynFloat64, name=PULSE_PERIOD, value is undefined
Parameter 11 type=asynFloat64, name=PULSE_WIDTH, value is undefined
Parameter 12 type=asynFloat64, name=PULSE_DELAY, value is undefined
Parameter 13 type=asynInt32, name=PULSE_COUNT, value is undefined
Parameter 14 type=asynInt32, name=PULSE_IDLE_STATE, value is undefined
Parameter 15 type=asynInt32, name=COUNTER_VALUE, value is undefined
Parameter 16 type=asynInt32, name=COUNTER_RESET, value is undefined
Parameter 17 type=asynInt32, name=ANALOG_IN_VALUE, value is undefined
Parameter 18 type=asynInt32, name=ANALOG_IN_RANGE, value is undefined
Parameter 19 type=asynInt32, name=ANALOG_IN_TYPE, value=2, status=0
Parameter 20 type=asynInt32, name=ANALOG_IN_MODE, value is undefined
Parameter 21 type=asynInt32, name=ANALOG_IN_RATE, value is undefined
Parameter 22 type=asynFloat64, name=VOLTAGE_IN_VALUE, value is undefined
Parameter 23 type=asynInt32, name=VOLTAGE_IN_RANGE, value is undefined
Parameter 24 type=asynFloat64, name=TEMPERATURE_IN_VALUE, value=24.2597, status=0
Parameter 25 type=asynInt32, name=THERMOCOUPLE_TYPE, value=1, status=0
Parameter 26 type=asynInt32, name=THERMOCOUPLE_OPEN_DETECT, value=0, status=0
Parameter 27 type=asynInt32, name=TEMPERATURE_SCALE, value=0, status=0
Parameter 28 type=asynInt32, name=TEMPERATURE_FILTER, value=0, status=0
Parameter 29 type=asynInt32, name=TEMPERATURE_SENSOR, value is undefined
Parameter 30 type=asynInt32, name=TEMPERATURE_WIRING, value is undefined
Parameter 31 type=asynFloat64, name=WAVEDIG_DWELL, value is undefined
Parameter 32 type=asynFloat64, name=WAVEDIG_DWELL_ACTUAL, value is undefined
Parameter 33 type=asynFloat64, name=WAVEDIG_TOTAL_TIME, value is undefined
Parameter 34 type=asynInt32, name=WAVEDIG_FIRST_CHAN, value is undefined
Parameter 35 type=asynInt32, name=WAVEDIG_NUM_CHANS, value is undefined
Parameter 36 type=asynInt32, name=WAVEDIG_NUM_POINTS, value=1, status=0
Parameter 37 type=asynInt32, name=WAVEDIG_CURRENT_POINT, value is undefined
Parameter 38 type=asynInt32, name=WAVEDIG_EXT_TRIGGER, value is undefined
Parameter 39 type=asynInt32, name=WAVEDIG_EXT_CLOCK, value is undefined
Parameter 40 type=asynInt32, name=WAVEDIG_CONTINUOUS, value is undefined
Parameter 41 type=asynInt32, name=WAVEDIG_AUTO_RESTART, value is undefined
Parameter 42 type=asynInt32, name=WAVEDIG_RETRIGGER, value is undefined
Parameter 43 type=asynInt32, name=WAVEDIG_TRIGGER_COUNT, value is undefined
Parameter 44 type=asynInt32, name=WAVEDIG_BURST_MODE, value is undefined
Parameter 45 type=asynInt32, name=WAVEDIG_RUN, value=0, status=0
Parameter 46 type=asynFloat32Array, name=WAVEDIG_TIME_WF, value is undefined
Parameter 47 type=asynFloat64Array, name=WAVEDIG_ABS_TIME_WF, value is undefined
Parameter 48 type=asynInt32, name=WAVEDIG_READ_WF, value is undefined
Parameter 49 type=asynFloat32Array, name=WAVEDIG_VOLT_WF, value is undefined
Parameter 50 type=asynInt32, name=ANALOG_OUT_VALUE, value is undefined
Parameter 51 type=asynInt32, name=ANALOG_OUT_RANGE, value=0, status=0
Parameter 52 type=asynFloat64, name=WAVEGEN_FREQ, value is undefined
Parameter 53 type=asynFloat64, name=WAVEGEN_DWELL, value is undefined
Parameter 54 type=asynFloat64, name=WAVEGEN_DWELL_ACTUAL, value is undefined
Parameter 55 type=asynFloat64, name=WAVEGEN_TOTAL_TIME, value is undefined
Parameter 56 type=asynInt32, name=WAVEGEN_NUM_POINTS, value is undefined
Parameter 57 type=asynInt32, name=WAVEGEN_CURRENT_POINT, value is undefined
Parameter 58 type=asynFloat64, name=WAVEGEN_INT_DWELL, value is undefined
Parameter 59 type=asynFloat64, name=WAVEGEN_USER_DWELL, value is undefined
Parameter 60 type=asynInt32, name=WAVEGEN_INT_NUM_POINTS, value=1, status=0
Parameter 61 type=asynInt32, name=WAVEGEN_USER_NUM_POINTS, value=1, status=0
Parameter 62 type=asynInt32, name=WAVEGEN_EXT_TRIGGER, value is undefined
Parameter 63 type=asynInt32, name=WAVEGEN_EXT_CLOCK, value is undefined
Parameter 64 type=asynInt32, name=WAVEGEN_CONTINUOUS, value is undefined
Parameter 65 type=asynInt32, name=WAVEGEN_RETRIGGER, value is undefined
Parameter 66 type=asynInt32, name=WAVEGEN_TRIGGER_COUNT, value is undefined
Parameter 67 type=asynInt32, name=WAVEGEN_RUN, value=0, status=0
Parameter 68 type=asynFloat32Array, name=WAVEGEN_USER_TIME_WF, value is undefined
Parameter 69 type=asynFloat32Array, name=WAVEGEN_INT_TIME_WF, value is undefined
Parameter 70 type=asynInt32, name=WAVEGEN_WAVE_TYPE, value is undefined
Parameter 71 type=asynInt32, name=WAVEGEN_ENABLE, value is undefined
Parameter 72 type=asynFloat64, name=WAVEGEN_AMPLITUDE, value is undefined
Parameter 73 type=asynFloat64, name=WAVEGEN_OFFSET, value is undefined
Parameter 74 type=asynFloat64, name=WAVEGEN_PULSE_WIDTH, value is undefined
Parameter 75 type=asynFloat32Array, name=WAVEGEN_INT_WF, value is undefined
Parameter 76 type=asynFloat32Array, name=WAVEGEN_USER_WF, value is undefined
Parameter 77 type=asynInt32, name=TRIGGER_MODE, value is undefined
Parameter 78 type=asynUInt32Digital, name=DIGITAL_DIRECTION, value=0x0, status=0, risingMask=0x7f50, fallingMask=0x999ee8a8, callbackMask=0x0
Parameter 79 type=asynUInt32Digital, name=DIGITAL_INPUT, value=0xff, status=0, risingMask=0x7f50, fallingMask=0x999ee8d8, callbackMask=0x0
Parameter 80 type=asynUInt32Digital, name=DIGITAL_OUTPUT, value is undefined
  Port: TC32_1, board ID=306, board type=TC32
  analog inputs      = 0
  analog input bits  = 24
  analog outputs     = 0
  analog output bits = 24
  temperature inputs = 64
  digital I/O ports  = 4
  digital I/O port     0
    I/O port              = 10
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     1
    I/O port              = 11
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  digital I/O port     2
    I/O port              = 14
    I/O bits              = 8
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 1
    I/O port write only   = 0
    I/O port mask         = 0xff
  digital I/O port     3
    I/O port              = 15
    I/O bits              = 32
    I/O bit configurable  = 0
    I/O port configurable = 0
    I/O port read only    = 0
    I/O port write only   = 0
    I/O port mask         = 0xffffffff
  timers             = 0
  # counters         = 0  first counter      = 0  counterCounts =

So it is reporting 4 DIO ports, and gives an error reading number 2.

I will report this to the vendor.

I also see these errors during iocInit on Linux, but not on Windows. I will also report this problem to the vendor.

iocRun: All initialization complete
create_monitor_set("auto_settings.req",30,"P=TC32:")
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.597 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
2023/04/26 15:52:00.598 MultiFunction::setOpenThermocoupleDetect Error: Setting thermocouple open detect mode, err=24 Configuration not supported
epics> auto_settings.sav: 256 of 256 PV's connected
jeonghanlee commented 1 year ago

Thank you, @MarkRivers. Yes, the open detect mode, in uldaq, doesn't exist. That is one other issue that I want to bring up after this since I want to focus on only at a time.

Please see one example, at uldaq code

https://github.com/mccdaq/uldaq/blob/1d8404159c0fb6d2665461b80acca5bbef5c610a/src/AiDevice.cpp#L753

uldaq Linux libraries need more logic to handle them.

By the way, do we have the source codes for Windows libraries or some development documents for TC-32? I want to look at them whether I can modify uldaq directly.

MarkRivers commented 1 year ago

Please see one example, at uldaq code https://github.com/mccdaq/uldaq/blob/1d8404159c0fb6d2665461b80acca5bbef5c610a/src/AiDevice.cpp#L753

I think you are misunderstanding that code. That is the aiDevice base class, and many methods return ERR_CONFIG_NOT_SUPPORTED. In this case the base class method is AiDevice::setCfg_ChanOpenTcDetectionMode. However, the derived classes can override the base class methods to implement those methods.

This line is where the AiETc32 derived class implements that method: https://github.com/mccdaq/uldaq/blob/1d8404159c0fb6d2665461b80acca5bbef5c610a/src/net/ai/AiETc32.cpp#L424

So the problem must be more complicated, since that derived class does indeed implement the method.

MarkRivers commented 1 year ago

I have contacted Agilent to determine how to report these issues. I was told to post to their Measurement Computing forum, which I have done. https://forum.digilent.com/topic/25638-2-issues-with-tc-32-on-linux/

By the way, do we have the source codes for Windows libraries or some development documents for TC-32? I want to look at them whether I can modify uldaq directly.

No, the Windows code is not available. You can definitely modify uldaq directly. I have done that with no problems to add debugging and fix what I thought were some problems (which turned out to go away when I migrated from Ubuntu 18 to Ubuntu 22).

MarkRivers commented 1 year ago

I think I found the problem with the thermocouple detect. There are 2 functions for this:

    virtual void setCfg_ChanOpenTcDetectionMode(int channel, OtdMode mode);
    virtual void setCfg_OpenTcDetectionMode(int dev, OtdMode mode);

The first function sets it for each channel, the second sets it for each device. The TC-32 only supports the second call, setting for the entire device. I will fix the driver.

MarkRivers commented 1 year ago

I have resolved both issues.

MarkRivers commented 1 year ago

@jeonghanlee I think this issue can be closed. If you have other problems you should open a new issue.

jeonghanlee commented 1 year ago

Thank you, @MarkRivers.

I did not work on C++ since 2012, so my memory was gone to understand them correctly, but my suspicious feelings you found out in any way.

Yes, I will create another issue, when we have multiple TC-32 and E-TC units within a single IOC.

I will close this issue. Thank you.

jeonghanlee commented 1 year ago

I have resolved both issues.

* The problem with the DIO port was fixed by forcing 
  numIOPorts_=2 with TC-32 on Linux.  Agilent is working 
  on tracking down the problem, so there may be a better fix later.

* The open thermocouple detect was fix by using the option AI_CFG_OTD_MODE 
  rather than AI_CFG_CHAN_OTD_MODE in the call to ulAISetConfig.  This sets 
  the value for the entire module, rather than for each channel, which is 
  what the TC-32 supports.

Do you want to add these changes to the master branch? Or should I keep these changes, which I think, I can change, in my own patches or repository branch until the vendor find a solution?

MarkRivers commented 1 year ago

Sorry, I had committed them to the master branch, but I forgot to push to Github. They are there now.