data events for module devices
samos
Posts: 106
When if I define a touch panel(1000:2:0) combine it with a virtual device(32001:1:0)in a main code file.when the touch panel receives a event the data,string event fires.
but when I pass the touch panel to a module and define the data event in the module and not in the main program the event never fires. any ides?
but when I pass the touch panel to a module and define the data event in the module and not in the main program the event never fires. any ides?
0
Comments
I don't believe the association passes through to the module. There are other ways of linking devices together that might work better.
For example creating a DEV
example:
This little routine will send a double beep command to all the touch panels if any of the panel's button 1 is pushed.
The advantage of this is that you can easily address multiple devices with one reference. However, the devices are still unconnected and can still send and receive separate commands.
another example
This will send a double beep command to only the device that the button was pushed but will send a text message for all the TPs button number 1
there are other things to look at as well such as DEVCHAN and DEVLEV.
give those a look in the help file ans see if it helps you out.
example that works
******************************************************
PROGRAM_NAME='STANDERD_SRC'
DEFINE_DEVICE
dvTP = 10001:2:0
vdvTP = 32001:2:0
DEFINE_START
define_combine(vdvTP,dvTP)
DATA_EVENT[vdvTP]
{
string:
{
if(1) send_string 0, 'data.text
}
}
*********************************************************
example that does not work
******************************************************
PROGRAM_NAME='STANDERD_SRC'
DEFINE_DEVICE
dvTP = 10001:2:0
vdvTP = 32001:2:0
DEFINE_START
define_combine(vdvTP,dvTP)
DEFINE_MODULE 'Login' mdlLogin(vdvTP)
MODULE_NAME='Login'(dev vdvTP)
DATA_EVENT[vdvTP]
{
string:
{
if(1) send_string 0, 'data.text
}
}
******************************************************
i have a touch panel has four buttons with there string output port on each set as 2
then there string out is set to 1,2,3,4.
now in netlinx diagnostics i see a event for 10001:2:0 and 32001:2:0
like this
Line 72 :: String From [10001:2:1]-[1] - 11:24:57
Line 72 :: String From [32001:2:1]-[1] - 11:24:57
when the data event is not in the module and in the main_src the data.text is displayed in telnet, and when the data event is in the module the data is not displayed in telnet.
Mainline:
Module:
BTW I used a G3 browser panel not a real one
Next issue may be that panel internal strings will sent back on port 1 only. So i.e. a keypad string AKEYP-123 from the panel's internal keypads always is sent on port 1.