Modules question
can someone please explain me this syntax???
I have this module
MODULE_NAME='Denon_DVD3910_UI' (DEV vdvDevice, DEV dvTP, INTEGER nCHAN_BTN[], INTEGER nTXT_BTN[])
and this code section that I don't undertand
DEFINE_PROGRAM
// DEVICE ONLINE
[dvTP, nCHAN_BTN[DEVICE_ONLINE_BTN]] = [vdvDEVICE, DEVICE_COMMUNICATING]
// DATA INITAILIZED
[dvTP, nCHAN_BTN[DATA_INITIALZIED_BTN]] = [vdvDEVICE, DATA_INITIALIZED]
// POWER FEEDBACK
[dvTP, nCHAN_BTN[POWER_ON_BTN]] = [vdvDEVICE, POWER_FB] // DISCRETE POWER ON
[dvTP, nCHAN_BTN[POWER_OFF_BTN]] = ![vdvDEVICE, POWER_FB] // DISCRETE POWER OFF
// DISC TRANSPORT FEEDBACK
[dvTP,nCHAN_BTN[STOP_BTN]] = [vdvDEVICE,STOP_FB]
[dvTP,nCHAN_BTN[PLAY_BTN]] = [vdvDEVICE,PLAY_FB]
[dvTP,nCHAN_BTN[PAUSE_BTN]] = [vdvDEVICE,PAUSE_FB]
[dvTP,nCHAN_BTN[SLOW_FWD_BTN]] = [vdvDEVICE,SLOW_FWD_FB]
[dvTP,nCHAN_BTN[SLOW_REV_BTN]] = [vdvDEVICE,SLOW_REV_FB]
[dvTP,nCHAN_BTN[SCAN_FWD_BTN]] = [vdvDEVICE,SFWD_FB]
[dvTP,nCHAN_BTN[SCAN_REV_BTN]] = [vdvDEVICE,SREV_FB]
thanks
Ady
I have this module
MODULE_NAME='Denon_DVD3910_UI' (DEV vdvDevice, DEV dvTP, INTEGER nCHAN_BTN[], INTEGER nTXT_BTN[])
and this code section that I don't undertand
DEFINE_PROGRAM
// DEVICE ONLINE
[dvTP, nCHAN_BTN[DEVICE_ONLINE_BTN]] = [vdvDEVICE, DEVICE_COMMUNICATING]
// DATA INITAILIZED
[dvTP, nCHAN_BTN[DATA_INITIALZIED_BTN]] = [vdvDEVICE, DATA_INITIALIZED]
// POWER FEEDBACK
[dvTP, nCHAN_BTN[POWER_ON_BTN]] = [vdvDEVICE, POWER_FB] // DISCRETE POWER ON
[dvTP, nCHAN_BTN[POWER_OFF_BTN]] = ![vdvDEVICE, POWER_FB] // DISCRETE POWER OFF
// DISC TRANSPORT FEEDBACK
[dvTP,nCHAN_BTN[STOP_BTN]] = [vdvDEVICE,STOP_FB]
[dvTP,nCHAN_BTN[PLAY_BTN]] = [vdvDEVICE,PLAY_FB]
[dvTP,nCHAN_BTN[PAUSE_BTN]] = [vdvDEVICE,PAUSE_FB]
[dvTP,nCHAN_BTN[SLOW_FWD_BTN]] = [vdvDEVICE,SLOW_FWD_FB]
[dvTP,nCHAN_BTN[SLOW_REV_BTN]] = [vdvDEVICE,SLOW_REV_FB]
[dvTP,nCHAN_BTN[SCAN_FWD_BTN]] = [vdvDEVICE,SFWD_FB]
[dvTP,nCHAN_BTN[SCAN_REV_BTN]] = [vdvDEVICE,SREV_FB]
thanks
Ady
0
Comments
but what is this syntax?
is it a standard table or what?
Denon_DVD3910_UI is a module which apparently handles the user interface for controlling a Denon DVD while another module directly controls the Denon. These modules are usually offered to help you implement the control module and you would rarely actually use them in your system - I never have.
vdvDEVICE appears to a virtual device whose channels are being used as booleans carrying the state of the Denon in and out of the module.
dvTP is the touchpanel that the UI is displaying on.
nCHAN_BTN is an array of integers containing the button numbers on the touchpanel which have to do with the Denon UI
nTXT_BTN is an array of integers containing the vartext numbers on the touchpanel which have to do with the Denon UI
DEVICE_ONLINE_BTN is a constant used as a subscript to nCHAN_BTN to find the channel number for the button which conveys the Denon's online state.
DEVICE_COMMUNICATING is a constant used as a channel number in vdvDEVICE which holds the Denon's online state.
[vdvDEVICE, DEVICE_COMMUNICATING] is the value of the Denon's online state.
[dvTP, nCHAN_BTN[DEVICE_ONLINE_BTN]] = sets the state of the button on the touchpanel which displays the Denon's online state.
None of these is a "standard" item; they have all been created by the programmer.
Thanks Mark
I am alraedy using this modlue, and I do understand how to use and every thing is ok.
the parameters and all the rest are very clear, and I have documentation for this module.
this is the part I dont get where its coming from:
[dvTP, nCHAN_BTN[DEVICE_ONLINE_BTN]]
I know dvTP, I know nCHAN_BTN
what is the syntax and how they connected together?
Lets look at it as x and y
so what is [x,y] means in netlinx? From what I understood its a table systax - but I have no table here?
Well you know you have [device,channel] right?
In this case because it's using a button array you have [device,button_array[index]].
Now somewhere in the module code there is a variable array of nCHAN_BTN which holds the index values. This is likely in the UI module.
[dvTP, nCHAN_BTN[DEVICE_ONLINE_BTN]]
DEVICE_ONLINE_BTN is a declared constant which holds the index position for that particular channel.
I didn't see that module in the inconcert site for Denon, where did you get it?
search for device "3910" - I can't copy the link for you cause its a javascript window
well every thing is clear to me but this line
"Well you know you have [device,channel] right?"
was not...
I didn't know I have this table...
AMX devices can have input, output and feedback channels, depending on the type of device. They are all referenced by the [device, channel] nomenclature, and which channel type you are referencing is determined by context. A button press is an input channel; the button state is the feedback channel for the exact same channel number. The output channel for a button is the same as it's feedback, but it's possible for it to be different for other device types (like an IO port or relay). More often than not feedback and output are the same, but it's important to know they are different and might not be the same under some circumstances. Virtual devices, as far as I know, don't even have feedback channels because they don't physically exist, it's all outputs (it gets pretty murky sometimes dealing with output vs. feedback). When a [device, channel] pair is on the left side of an assignment, it is a feedback channel. When it's on the right, it's an output channel. What the statements in question are doing is setting the feedback of a button to the output state of a virtual device channel.
Thanks!
You made some order for me.
Amazing how much info I get from the forum that does not exist anywhere else.
Thanks again
Ady.
These file contain constants for all the devices that I think Dave was reffering to. Basically include files of numerous DEFINE_CONSTANT sections, one for each type of device.
C:\Program Files\Common Files\AMXShare\AXIs\G4API.axi
C:\Program Files\Common Files\AMXShare\AXIs\SNAPI.axi