I've developed a fairly complex Batching PLC program using an CLX 5000 L61 PLC interfaced to Wonderware 9.5. I converted the CLX program to use the RSLogix 5000 Emulator and modified the WW app to point to RSLinx OPC instead of the DAS Server. No problems and it works quite well for manually manipulating the process (writing I/O and toggling bits). I want to take it to the next step and create a Simulation package to where the customer can actively interract with the Wonderware HMI and the Logix 5000 Emulator to actually run simul-batches.
I created a routine in the CLX (called simulate) that (I was hoping) modelled the process. As a basic example, a rung of logic would monitor the motor starter (Output) and turn on the Motor Aux (Input) which would prevent the normal run aux fault from occurring and simulate that the motor came on. I also have a lot of logic simulating analog values fluctuating (rising tank levels, varying temperatures to PID loops, etc.).
Now the problem. All tags are aliased to real I/O in the rack and via ethernet flex I/O. I didn't use the Sim32 I/O in the emulator (really saw no need). To manually manipulate the process all I had to do was use tag monitor and write (not force) a value into the tag aliased to the I/O point and all worked well. Even with analog, I could write a value of say 50% to a tag aliased to an analog input module, and the 50% value would stick. Same for thermocouple inputs, etc. For discrete, I could simply write a 1, or 0 and it would stick (again, no forcing).
However, the same functionality doesn't appear to hold true when doing it through logic. If I try to write a '1' to an Input tag, it toggles between 0 and 1 (length of scan time I imagine). I have a decrementing CPT function to simulate a tank running out with the following logic:
--[tank mode auto]----[level >= 0]-----[CPT level = level - 5]--
That works until the level hits zero and then poof, it jumps back to the initial value I had stuck in the tag through tag monitor and the above logic of course cycles again. So, to summarize, if I go to tag monitor and write a value of 50% into level, it stays at 50%. But if I turn [tank mode auto] on above, it decrements to 0 and then pops back to 50. If I write a value of 20% in tag monitor it does the same but pops back to 20.
For discretes, I have as an example:
----[motor]------------[motor aux]----
If I turn [motor] on, [motor aux] flashes on/off. If I write on to motor aux it turns on and stays on, until [motor] turns off to which it goes back to flashing off/on.
So, is there any way to do the type of full simulation I want using the RSLogix emulator (I know I could turn off the OPC and do it all in ww script, but I'd like to use the logic I have)? My only thought is to de-alias everything, but I'm confused as to why a write in monitor works, but a write through logic does not. I was hoping to keep one program and activate/deactivate simulation mode via an engineering bit from WW. If I have to dealias then I end up with two programs to maintain.
Update: I found that if I Inhibit the module aliased to the tag it prevents the above behavior. So, as a work around, can I use the simuation enable tag to dynamically inhibit I/O modules and if so, any danger to moving in/out of inhibit? I see that there is an SSV means to inhibit modules.
I created a routine in the CLX (called simulate) that (I was hoping) modelled the process. As a basic example, a rung of logic would monitor the motor starter (Output) and turn on the Motor Aux (Input) which would prevent the normal run aux fault from occurring and simulate that the motor came on. I also have a lot of logic simulating analog values fluctuating (rising tank levels, varying temperatures to PID loops, etc.).
Now the problem. All tags are aliased to real I/O in the rack and via ethernet flex I/O. I didn't use the Sim32 I/O in the emulator (really saw no need). To manually manipulate the process all I had to do was use tag monitor and write (not force) a value into the tag aliased to the I/O point and all worked well. Even with analog, I could write a value of say 50% to a tag aliased to an analog input module, and the 50% value would stick. Same for thermocouple inputs, etc. For discrete, I could simply write a 1, or 0 and it would stick (again, no forcing).
However, the same functionality doesn't appear to hold true when doing it through logic. If I try to write a '1' to an Input tag, it toggles between 0 and 1 (length of scan time I imagine). I have a decrementing CPT function to simulate a tank running out with the following logic:
--[tank mode auto]----[level >= 0]-----[CPT level = level - 5]--
That works until the level hits zero and then poof, it jumps back to the initial value I had stuck in the tag through tag monitor and the above logic of course cycles again. So, to summarize, if I go to tag monitor and write a value of 50% into level, it stays at 50%. But if I turn [tank mode auto] on above, it decrements to 0 and then pops back to 50. If I write a value of 20% in tag monitor it does the same but pops back to 20.
For discretes, I have as an example:
----[motor]------------[motor aux]----
If I turn [motor] on, [motor aux] flashes on/off. If I write on to motor aux it turns on and stays on, until [motor] turns off to which it goes back to flashing off/on.
So, is there any way to do the type of full simulation I want using the RSLogix emulator (I know I could turn off the OPC and do it all in ww script, but I'd like to use the logic I have)? My only thought is to de-alias everything, but I'm confused as to why a write in monitor works, but a write through logic does not. I was hoping to keep one program and activate/deactivate simulation mode via an engineering bit from WW. If I have to dealias then I end up with two programs to maintain.
Update: I found that if I Inhibit the module aliased to the tag it prevents the above behavior. So, as a work around, can I use the simuation enable tag to dynamically inhibit I/O modules and if so, any danger to moving in/out of inhibit? I see that there is an SSV means to inhibit modules.
Last edited: