Experimental Physics and
| |||||||||||||||
|
Hi all, I have a simple question about stream. The device was connected with LAN. If sending " fe 04 00 00 00 01 25 c5 " in Hex, getting " fe 04 02 04 08 ae 22 " in Hex. Among the getting bytes( " fe 04 02 04 08 ae 22 "), 04 08 was I wanted. Convert 0408(HEX) to decimal was 1032 (4*16**2 +8=1032), and 1032 was the finall result I wanted. In my programe, I have successfully sent and got the bytes. But I could not get the 1032, I want to achieve it using scalcout, but failed. Could you please give me some suggestion. The environment I use, base3.14.12.7, synapps_5_8, fedora 27(64). my db file: -------------------------------------------- record(stringin, "GET_HIGH") { field(DESC, "test for upstairs tcpip") field(DTYP, "stream") field(INP, "@devtemp.proto get_high $(PORT) $(A)") } record(stringin, "GET_LOW") { field(DTYP, "stream") field(INP, "@devtemp.proto get_low $(PORT) $(A)") field(SCAN, "I/O Intr") } record(scalcout, "TEM") { field(DESC, "get the temperature") field(DTYP, "stream") field(INPA, "GET_HIGH") field(INPB, "GET_LOW") field(CALC, "A*16*16 + B") } my proto file: ------------------------------------------------------- get_high { out "\xFE\x04\x00\x00\x00\x01\x25\xC5"; in "%*c%*c%*c%*c%*c%*c%c%c%*c%*c%*c%*c%*c%*c"; # in "%s"; } get_low { in "%*c%*c%*c%*c%*c%*c%*c%*c%c%c%*c%*c%*c%*c"; } output of st.cmd: (there is an error "Record "TEM" is of unknown type "scalcout" ) ------------------------------------ #!../../bin/linux-x86_64/temp ## You may have to change temp to something else ## everywhere it appears in this file < envPaths epicsEnvSet("ARCH","linux-x86_64") epicsEnvSet("IOC","ioctemp") epicsEnvSet("TOP","/home/lyx/tem_setup_with_asyn_scpi") epicsEnvSet("EPICS_BASE","/opt/epics/base") epicsEnvSet("ASYN","/opt/epics/synApps_5_8/support/asyn-4-26") epicsEnvSet("STREAM","/opt/epics/synApps_5_8/support/stream-2-6a") epicsEnvSet "STREAM_PROTOCOL_PATH" "/home/lyx/tem_setup_with_asyn_scpi/db" epicsEnvSet "P" "P" epicsEnvSet "R" "T" cd "/home/lyx/tem_setup_with_asyn_scpi" ## Register all support components dbLoadDatabase "dbd/temp.dbd" temp_registerRecordDeviceDriver pdbbase drvAsynIPPortConfigure("L0","192.168.215.120:10000",0,0,0) asynSetTraceIOMask("L0",-1,0x2) asynSetTraceMask("L0",-1,0x9) ## Load record instances dbLoadRecords("/home/lyx/tem_setup_with_asyn_scpi/db/devtemp.db","P=P,R=T,PORT=L0,A=0,user=lyxHost") Record "TEM" is of unknown type "scalcout" Error at or before ")" in file "/home/lyx/tem_setup_with_asyn_scpi/db/devtemp.db" line 25 cd "/home/lyx/tem_setup_with_asyn_scpi/iocBoot/ioctemp" iocInit Starting iocInit ############################################################################ ## EPICS R3.14.12.7 ## EPICS Base built Feb 7 2018 ############################################################################ Regards, Li xing
| ||||||||||||||
ANJ, 19 Feb 2018 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |