Applies To: |
|
Summary: |
I must use the Optomux Data Types IOC# or
CIO$* upon start-up to configure each of the modules in my dept's
system. The problem now is how do I employ these commands? Do I
create a Variable Tag for each separate command for each address on
each IO device? The "Optomux Commands" help file states "You can
issue commands to your Optomux controllers, either
within a Cicode function, or in a keyboard command" which implies to me that I can directly issue these Optomux commands to the IO Device via some Cicode function, but the closest function I can find for this is IODeviceControl() which isn't quite it. Anyway, would it be possible to give an example of how to implement the IOC# and CIO$* commands in Citect, preferably using Cicode? |
Solution: | ||||||||||
The Optomux data types IOC# or CIO$*
basically do the same thing except using CIO$* is a much more
efficient when configuring. The description for these 2 data types
is below:
As you can see IOC# configures individual modules at a time (0 to 15) whereas CIO$* configures all the modules in one go. e.g Lets say you wanted to change all modules to outputs. Firstly you will need to configure a variable tag for each address. Variable tag : IOC0 You will need to do the same for IOC1..IOC15. To set each module to an output (in cicode say) you will need to set
The exact same thing can be achieved using CIO$* by configuring one tag Variable tag : AllOutputs Where FFFF is the bit mask for the modules. In order for this to done in cicode you will need to assign an arbitrary value to this tag. E.g
Although I have assigned AllOutputs=1, Citect does not actually read the value assigned to it, just the fact that you have assigned something. You have already set all the modules to outputs via the "FFFF" in the address. Just to clarify the addressing with on last example. Lets set positions 7, 8, 9 and 10 to be output and set the other positions to be input. The format for the address will be
where the '1' refer to the output. Hence when converted to Hexadecimal we get 0780. So the tag will be CI0$780 = 0. |
Keywords: |
Related Links
Attachments