Citect - Simulation, how?

ongzy

Member
Join Date
Dec 2010
Location
Selangor
Posts
100
How to simulate a SCADA program using Unity Pro?
Am a beginner. Anyone has a detailed step by step guide file?


SCADA & PLC programs have both been built.
Tried the connection. Only zero values shown.
Altering of values do not change data in SCADA,
 
Citect will run normally without a valid licence for a short period of time.
Enables testing of comms with PLCs etc without licence.

Cut & Paste from Citect Help file.
Demo mode

You can run CitectSCADA without the hardware key in demonstration (Demo) mode. Demonstration mode lets you use all CitectSCADA features normally, but with restricted runtime and I/O.
Note: If you configure CitectSCADA to run as multiple processes on one CPU or multiple CPUs, you cannot use CitectSCADA in demo mode. If you run CitectSCADA as one process, you can use demo mode as with previous versions of CitectSCADA.

The following demonstration modes are available:
  • 15 minutes with a maximum of 50,000 real I/O.
  • 10 hours with no static points and a maximum of 1 dynamic real I/O. This is useful for demonstrations using memory and disk I/O. CitectSCADA starts in this mode if no static points are configured.
  • If you want to demonstrate DDE, CTAPI, or ODBC writes to CitectSCADA in this mode, you can only write 1 point. To write to more than 1 point, you must force CitectSCADA to start in 15 minute-50,000 I/O demo mode by creating at least one static I/O point.
    For this to work, you must configure a real variable tag, with an accompanying PLC or I/O device. The tag must be used by a page or in Cicode. If you do not have a real I/O device connected, CitectSCADA gives a hardware error, which you can disable using the IODeviceControl function.
  • 8 hours with a maximum of 42,000 real I/O. This is only available through special CitectSCADA Integration Partners (CIP) keys.
 
From memory
In Unity
1. on the top menu under plc select simulate mode
2. rebuild all
3. connect and download to the plc (this will automatically set to the simulator)
4. run the plc (note all the unity commands will act on the simulator)
5. note on the bottom right hand status bar the ip address is 127.0.0.1
6. In citect if you are on the same pc as the unity simulator you will need to set the ip address of your io device to 127.0.0.1. If Citect is on a different pc then set the io device ip to the address of the pc with Unity running on it.
7. start Citect
 
6. In citect if you are on the same pc as the unity simulator you will need to set the ip address of your io device to 127.0.0.1. If Citect is on a different pc then set the io device ip to the address of the pc with Unity running on it.

This is what I did.

In Citect Project Editor
Communcation>Port>Special Opt>
Change to -I127.0.0.1 -PO -T


Simulator runs well. Reset button pressed, everything goes to 0.
But how can we alter those values to see how Citect works on a simulated PLC?
 
Found. At Unity Pro:
>Project Browser > Variables & FB instances > Elementary Elements

1. Change value
2. Transfer Project to PLC
3. Run

Looks like it only changes value when you do step 2 & 3.
So, we can't do immediate changes and see the effect?
 
right click the variable select animation table, at the top of the table select modify variable, enter a value into the variable
 
I have got a very weird thing.

When I transfer project to PLC, PLC is stopped.
Values can be modified and changes are showed on SCADA.

When I run the PLC, all measurement values return to zero.
Only setpoint values stay. Why???
 
Last edited:
Ok I know now. Simulation PLC is trying to get values from i/o device.
How can I disable the function so that I can change i/o device measure value so as to test out the whole project like a real plant?
 
Ok I know now. Simulation PLC is trying to get values from i/o device.
How can I disable the function so that I can change i/o device measure value so as to test out the whole project like a real plant?
You can force any variable in the animation table of Unity Pro, even I/O.

Also, in our projects we usually provide possibility of input simulation in the I/O processing DFBs.
 
You can force any variable in the animation table of Unity Pro, even I/O.

Also, in our projects we usually provide possibility of input simulation in the I/O processing DFBs.


Hi thanks for answering. I'm now in a real plant already. =)

Can I force values in the animation table running on a real PLC?
I tried to force a value on a contact but force function is greyed out.
I only managed to use the set function. But then it is undesirable because we have to search for the roots of the contact to get a desirable output.
 
How to simulate with Citect comms

I have been successfully running simulation on one PC with Citect on another without any problem.

How to setup the PLC simulator to behave as a PLC
1. Set the PC IP address to the PLC IP address to be simulated.
2. Run the simulator, and check the Host IP address displayed on the panel matches the correct IP address. If it is not correct, you have more than one network card. Disable other networks. I have not figured out any way to force it to a particular network adaptor.
3. Set Unity to Simulator mode, and set the simulator IP address to the PLC address.
4. Connect to the simulator and load the program.
5. Run Citect, and it should all communicate the same as being connected to a PLC. Note: if you want to run Citect in Demo mode, be sure to have "[LAN] TCPIP=0" in the Citect ini file.


How to simulate IO in the PLC
I normally map all my Digital and Analog inputs with simulation tags in ST, which I enable with a SimMode tag. I then write full simulation logic elswhere.
Here is some ST logic that I use

IF SimMode THEN
DigitalInput := WRITE_INPUT_EBOOL (INP := SimState );
AI.Value := WRITE_INPUT_INT (INP := Sim_AI_Raw );
End_If;

The WRITE_INPUT_* functions effectively force the inputs in the logic. If you want to do this in a live PLC overriding the actual connected IO, be sure to place the routine at the top, so it overwrites any IO updates.

I hope this clears up how to do it.
 
Last edited:
Can I force values in the animation table running on a real PLC?
I tried to force a value on a contact but force function is greyed out.

To answer your question, it depends on the declaration.

You can only force EBOOL, not BOOL.
If the force is greyed, then you are probably wanting to force a BOOL.
 
In addition to my previous post, I just figured out the best way to force the simulator IP address. I am sure somebody will find it useful.

The simulator will take on the IP address of the network adapto with the highest priority. This priority can be changed very easily.
1. Run "ncpa.cpl" (open network connections).
2. On the "Advanced" menu, click "Advanced Settings..." (For Windows 7 pres ALT key to show menu bar)
3. Re-order the adaptors so that the adaptor that will be used to access the simulator is at the top.
 

Similar Topics

Hi all ! I am currently doing a new project (to include into an existing site's project) in Citect SCADA 2018. There are existing IO Servers on...
Replies
1
Views
1,571
Hi all, I have a system running a Modicon M340 with Unity Pro and a Magelis Compact iPC with Citect SCADA v7.0 connected via a managed ethernet...
Replies
2
Views
2,952
Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
65
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
72
Back
Top Bottom