Host Engineering Forum
General Category => Ethernet SDK => Topic started by: StuGrunt on January 19, 2016, 02:04:30 PM
-
I am calling HEIWriteSetupData to set the watchdog on an EBC100 with numerous modules attached.
I am using C# using the old VB code as a guide.
This is my call:
result = HEI.HEIWriteSetupData(ref aDevices[did], DT_LINK_MONITOR, ref tBuffer[0], tBuffersize);
I can get it to set the watchdog to 5 seconds and set all outputs off by sending (this works):
88 12 00 00 500ms timer
00 turn off outputs when it fires
FF termination
I am not sure what I should be sending if instead I desire a pattern to be set upon watchdog timeout.
The part that is unclear is the data buffer.
The data buffer is 251 bytes. and says I should use the same format as for the HEIWriteIO call.
Does that mean I need to fill the Data[251] buffer (of the LinkMonitor structure) with:
B1 00 header
00 01 slot ID
04 digital output
255 num bytes
00 00 .... data
FF termination
So, in total, what I am actually attempting to send is:
88 12 00 00 5000ms timer Timeout
01 use pattern Mode
B1 00 header (A) Data[0][1]
00 01 slot ID (B) Data[2][3]
04 digital output Data[4]
255 num bytes Data[5]
00 00 .... data Data[...]
FF termination
1) Should I be leaving out the header (A) and/or slot ID (B)?
2) Do I just append the other modules starting at the (B) line above and just ensure I end with 0xFF?
I am confused where it starts. Should I just be starting at the data and ignore the header and slot info?
-
it looks like you are doing it correctly. the "data" portion is formatted exactly like a WriteIO packet:
B1 00
Slot, Type, NumBytes, Data
Slot, Type, NumBytes, Data
Slot, Type, NumBytes, Data
....
FF