I am trying to program a SDM-IO16 according the following channel mapping:
Does anyone know how to write some efficient code to accomplish this?
In this case, there isn't any way around calling the SDMIO16 instruction a bunch of times.
You can address groups of 4 channels. If you shift your pulses down the channels and leave 12 free, It would simplify the relays a little bit.
You need to run a setup instruction between BeginProg and Scan
SDMIO16 (Setup,Status(1),0,90,9322,2000,0000,0000,1,0)
Code 90 tells the ports what they are from the mode parameters
Then you will need an SDMIO16 instruction in the program using code 95 using variables to control the condition of the ports
3 x SDMIO16 instructions to read the frequencies of port 12,13,& 14 using codes 35, 36 & 37 respectively
and a final SDMIO16 instruction using code 15 to tally the pulses on port 15
Not terribly elegant but it should do what you want