Simulated Libraries

Navigation:  Libraries >

Simulated Libraries

Previous pageReturn to chapter overviewNext page

A set of simulated libraries are provided that can be used with the Codesys Win V3 Target.

Code can be written for the Unidrive M and the MCi200/210, run with the simulated libraries without connecting to a target and tested. This code can then be copied into a project that uses the real devices.

The Codesys Win V3 target can be logged into and the simulated program downloaded to it. Parameter values can be read from and written to.

 

The following simulated libraries are provided:

 

Simulated CT User Programming Runtime,
Simulated CT User Programming Runtime - MCi,

 

Create a project for using the simulated libraries

Create a new project using the "Standard Project" template as show below:

 

Standard Project

 

Select the device to use as "CODESYS Control Win V3".

 

Control Win V3

 

When the project has opened double-click on the Library Manager in the Device Tree.Add the Simulated library and the CT Unidrive M Parameter Library.

 

LibraryManager

 

Select the "CT Unidrive M Parameter Library" and click on the Placeholders button.

Set the Library for "CT User Programming Runtime" to "Simulated CT User Programming Runtime".

 

Placeholders

 

The program can now written using Unidrive M parameters and run on the Soft PLC target.

 

 

Connecting to the Soft PLC Target

 

The soft PLC must be started and this can be located on the system tray as shown below. Right-click on the CODESYS Control Win SysTray and start the PLC.

 

WinSysTray

 

Double-click on the CODESYS_Control_Win_V3 target on the device tree to launch the device communications page, as show below:

 

CommsSettings

 

Ensure that the Gateway is not the "Control Techniques" Gateway, but references "Gateway-1". Select your PC in the right-hand drop down selector.

 

 

Running the Simulated Code on Real Target

 

Programs written with the simulated library can be copied to a real target by adding the target to the project and copying the POU(s) from the simulated device to the real device.

This is shown in the image below:

 

POU Copy