again, in my explaination above, you will need to see if your 16 C bits are in a complete word, or make them so (at least the "Small indian" last 4 bits).
You will have to do a combination of a Brian and VB, for instance if you want to send tool #2 to your PLC.
in VB you will send the next tool you want to change to, to the PLC.
i.e.
NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
if OldTool <> NewTool then
SetUserDRO(2000, NewTool)
end if
SystemWaitFor (INPUT4) 'when the PLC is done, it can turn on input4 so the M6 will drop out.
SetOEMDRO(824, NewTool)
'////////////////////////////////////
The above will load the NewTool (next tool wanted), into User DRO 2000.
Then in a Brian, Lets say that your Cfg0 is your output cfg on a serial modbus. That will load the value of DRO 2000
into the First (starting address) of your PLC range for that config.
Brain: (using plugin enabled serial modbus)
DRO 2000 ->NoOp -> Serial P MB, out, cfg0, address 0
So, in your PLC, if you do a data view on the word that contains the 16 control bits (your just using the lower 4).
So in decimal that word would now contain a 2.
in binary it would have a 0000000000000010 at the end.
thus C0 = 0, C1 = 1, C2 = 0, C3 = 0
The example that VMax refered to above, was/is for a much more complex "Hot Swap" code, you dont get any gain in speed with that code unless you have a swap arm.
So, do a Search for ATC in the VB thread, you will find several examples for doing ATC's.
scott