Product : ISaGRAF 3.3
Date : 31-March-00
File : Retreive NT target Slave number.htm
Subject : How from IEC code know what is NT target slave number
Keywords: Slave number - IEC appplication - NT target
To get such information from the IEC code, what you can do is to
write a C function that will return the slave number.
If you write that C function for NT target, one problem is that the user function DLL (isausp.dll) can not access easily the global variables of the executable or other DLLs.
So what we advise you is:
- add in the system layer (inside Isasys.dll) 2 functions:
slave_num_set => this function will write in a new global variable of isasys.dll what is current slave number
slave_num_get => this function will return that new global variable value ( i.e. current slave number).
Those two functions need to be exported from Isasys.dll.
- inside a standard hook function like dba_init (in file tant0dba.c for NT target)a call to slave_num_set like follow:
/* SYST in a global structure already defined, that contains kernel system information.
SYS type is 'str_system', 'str_system' is defined in Tasy0df2.h */
- Create an ISaGRAF "C Function" (that means declare function interface in workbench library and link its C code to isausp.dll)
that calls slave_num_get
For other targets, use SYST->slave in standard hooks like dba_init (in taio0ker.c) or in a C function.
Copyright © 1996-2009 ICS Triplex ISaGRAF Inc. All rights reserved.