WCD_BWDG
Member
So, I'm almost certain there is no great answer to this question, but I thought I would poll the masses for expert opinion...
I'm running a valve monitor using a FOR loop. I have an AutoValve UDT, and in it are BOOL's like IsOpen, IsClosed, Energize, Deenergize, and Request. A have an instance of this UDT for every valve (XV_1000, XV_1001, etc.), and each instance is aliased to a member of a comprehensive Valve array. The FOR loop steps an Index DINT and calls the Valve_Monitor routine. Inside the routine, a ValveBuffer is set equal to Valve[Index]. Logic is executed and either Energize or Deenergize is enabled. The Energize and Deenergize should then trigger a signal to be sent to the actual field device.
I'm using FlexIO in my control panel. I've built the I/O configuration and Local IO tags were generated which link to the actual input and output signals coming off the cards. As far as I know, these Local IO tags, the individual Valve array member tags, and the tags within my AutoValve UDT's all can not be assigned aliases.
What I want to know is this: is there any way to read and write to the Local IO tags within my Valve_Monitor? A way to indirectly reference the Local IO tags so that each valve passed into the buffer could write to its own specific Local IO tag?
Do you see my problem? Every new valve passed into the buffer has its own IO address that has to be written to or read from. And not just for valves, for motors and analog devices also. If I use a loop, there is no way to dynamically reference the Local IO tags because I can't alias them from an array and I can't alias them to an array either. Without hard-coding a massive list of conditional statements and using an address tag in the UDT to match the incoming valve to a specific Local IO tag, I don't know what else could work.
I've had a lot of trouble trying to cross the boundary from PLC code to field device. If there is a way to indirectly reference a tag (as in use a String tag to store the Local IO tagname, place that String tag into some instruction, and have the instruction reference the value of the String tag) or if you can think of any other solution to my problem, please help me out! I would really appreciate it and could save people a lot of time.
Thanks in advance!
Bill
I'm running a valve monitor using a FOR loop. I have an AutoValve UDT, and in it are BOOL's like IsOpen, IsClosed, Energize, Deenergize, and Request. A have an instance of this UDT for every valve (XV_1000, XV_1001, etc.), and each instance is aliased to a member of a comprehensive Valve array. The FOR loop steps an Index DINT and calls the Valve_Monitor routine. Inside the routine, a ValveBuffer is set equal to Valve[Index]. Logic is executed and either Energize or Deenergize is enabled. The Energize and Deenergize should then trigger a signal to be sent to the actual field device.
I'm using FlexIO in my control panel. I've built the I/O configuration and Local IO tags were generated which link to the actual input and output signals coming off the cards. As far as I know, these Local IO tags, the individual Valve array member tags, and the tags within my AutoValve UDT's all can not be assigned aliases.
What I want to know is this: is there any way to read and write to the Local IO tags within my Valve_Monitor? A way to indirectly reference the Local IO tags so that each valve passed into the buffer could write to its own specific Local IO tag?
Do you see my problem? Every new valve passed into the buffer has its own IO address that has to be written to or read from. And not just for valves, for motors and analog devices also. If I use a loop, there is no way to dynamically reference the Local IO tags because I can't alias them from an array and I can't alias them to an array either. Without hard-coding a massive list of conditional statements and using an address tag in the UDT to match the incoming valve to a specific Local IO tag, I don't know what else could work.
I've had a lot of trouble trying to cross the boundary from PLC code to field device. If there is a way to indirectly reference a tag (as in use a String tag to store the Local IO tagname, place that String tag into some instruction, and have the instruction reference the value of the String tag) or if you can think of any other solution to my problem, please help me out! I would really appreciate it and could save people a lot of time.
Thanks in advance!
Bill