Dev Array In Call
xrmichael
Posts: 79
Could someone help me out with the following.
I have an array of panels
DEV dvTP[]={dvTP1_1,dvTP2_1,dvTP3_1,dvTP4_1,dvTP5_1}
I can do this to send a command to all panels
SEND_COMMAND dvTP,"'@PPX'" //CLOSE ALL POPUPS
I have a call like this
DEFINE_CALL 'closepps' (DEV PANEL)
{
SEND_COMMAND PANEL,"'@PPX'" //CLOSE ALL POPUPS
}
But cannot do this - call 'closepps' (dvTP)
I have probably missed something as i normally do.
Michael
I have an array of panels
DEV dvTP[]={dvTP1_1,dvTP2_1,dvTP3_1,dvTP4_1,dvTP5_1}
I can do this to send a command to all panels
SEND_COMMAND dvTP,"'@PPX'" //CLOSE ALL POPUPS
I have a call like this
DEFINE_CALL 'closepps' (DEV PANEL)
{
SEND_COMMAND PANEL,"'@PPX'" //CLOSE ALL POPUPS
}
But cannot do this - call 'closepps' (dvTP)
I have probably missed something as i normally do.
Michael
0
Comments
But anyway - in your call parameter, it's set for only a single device. It should be:
DEFINE_CALL 'closepps' (DEV PANEL[MAX_PANELS])
Where MAX_PANELS would (obviously) be the maximum number of panels you have in the system. I don't know if defining the bounds of the array is necessary for a call / function, but it doesn't hurt I don't think.
There will be more than one line of code, that was just an example, i will give your suggestion a try now thanks for the quick response.
A few complier errors in the call now relation to a dimension mismatch. I will keep pluggin on.
I have tried empty [] in the call
DEFINE_CALL 'CLOSEPPS' (DEV PANEL[])
But it throws these errors
Dimension mismatch: [1] vs. [0]
Type mismatch in call for parameter [PANEL]
I will knock up a hack to get round it and pick it back up Monday it's friday and nearly home time.
I would not use a function for this. But If I Did, Here's How It Happened:
Thanks you have confirmed I was not going mad, ended up doing it with a for loop style thing.
Jeff
I have all kinds of functions that take an array of devices. Maybe you could post all the code as I have a feeling the problem may lie elsewhere.
Paul
Here's a similar example I use for pop up control:
Paul
Some where else in the code during the UI arrays online event I run the DEVICE_ID command as UI's come online to determne there type and store that info in an array. Then in a particular module I can control feedback based on this type depending on that module's particular needs, also whether or not they are on the particular device page and on the particular instance of a module if that applies.
I generally have something like this for all types of feedback, level, channel, VT, etc...
I run this in my main code and pass it to modules as needed.
Here's my current collection of device id's. Still need the newer panels.