Questo sito utilizza i cookie per migliorare servizi ed esperienza degli utenti. Se decidi di continuare la navigazione consideriamo che accetti il loro uso.

Panoramica Cerca Sopra
Dettagli del download
Sample02: Cyclic C++ logic using IO from IO- Sample02: Cyclic C++ logic using IO from IO-task
(1 vota)

This demo describes the flexibility of C++ code to work on the IO's which are configured at the IO-Task. This approach allows providing a compiled C++ module to act more flexible on different numbers of IOs connected at the IO-Task. A use case would be to check cyclically analogue input channels where the number of channels might differ on different projects.

 

The sample contains

the C++ module "TcIoTaskImageAccessDrv" with an instance of that module "TcIoTaskIMageAccessDrv_Obj1"
A task "Task1" with an image and 10 input variables (Var1..Var10) as well as 10 output variables (Var11..Var20).
They are connected: The instance is called by the task and the instance uses the image of Task1.

The C++ code accesses the values via a data image, which is initialized within the "SAFEOP to OP" (SO) transition.

Within the "CycleUpdate" method, which is executed cyclically, each input variable is checked on its value by calling the helper method "CheckValue". If it’s less than 0 the corresponding output variable is set to 1; if it is greater than 0, it is set to 2 and if it’s 0 output equals 3.

After activating the configuration you can access and set the variables via the Solution Explorer.
Double-click the Task1-Image of the System for an overview.
The input variables could be set by opening them and using the "Online"-Tab.

Informazioni

Versione:
Dimensione17.44 KB
Downloads1
Lingua
Licenza
Autore
Sito Web
Prezzo
Creato17-02-2015
Creato da
Modificato il17-02-2015
Modificato daroby

Solo gli utenti registrati e loggati possono scaricare questo file.

.

.