I will use CR1000, SDM16AC and SDM-SW8A to controll and monitor pump and some valve, I have read the handbook and learning the program, but i'm not understand what the code to reading every single port/channel in SDM-SW8A. in sample program is only measure all channels of an SW8A,example:
'Program Declarations
Public SW8ACount(8)
'Data Table Declarations
DataTable (CountTab,1,1000)
DataInterval (0,1,Min,10)
Sample (8,SW8ACount(),FP2)
EndTable
'Main Program
BeginProg
Scan (1,Sec,3,0)
SDMSW8A (SW8ACount(),8,0,2,1,1.0,0)
CallTable CountTab
NextScan
EndProg
in this case, how to know that channel 1 / others is getting input from pump or valve. Anyone can help me to give a little sample program, please..
Regards,
Vai
In your CRBasic Editor right click on the blue instruction SDMSW8A, this will bring up the parameter dialog box which will help you decipher what each part of the instruction does.
Destination: SW8ACount()
Repetitions: 8
SDMAdddress: 0
FunctOpt: 2
SW8AStartChan:1
Multiplier: 1
Offset: 0
The Repetitions and SW8AStartChan parameters tell the SDM-SW8A which channels to read. In your example you are looking at all 8 channels (Repetitions parameter) starting with channel 1 (SW8AStartChan parameter).
I hope this helps. If not please post again.
Regards,
Janet