Ports
adys
Posts: 395
Can some please give a short eplain /example about port use in netlinx?
What is the command port/channel port/address port/string port for?
Thanks
Ady
What is the command port/channel port/address port/string port for?
Thanks
Ady
0
Comments
- command port is where you get BUTTON_EVENT in netlinx source and switching ON/OFF a 'general' button
- address port is for writing a text to a button or setting a 'multi-state general/bargraph' button to a specified state
- level port is where you get LEVEL_EVENT of a 'bargraph' button or SEND_LEVEL to a bargraph button
if your tp has device number 10001, then use
10001:2:0 in netlinx source for all port 2 in tp design and so on, we usually use ports from 1 up to port 10 for different modules.
For every channel code there is a channel port only be expand the number?
is there any smart use to do with it?
One thing is that it gives you the ability for a device to have a huge amount of channels. For example, a modero panel allows for 3,999 buttons per port.
But since you can have more than one port you multiply that 3,999 by how many ports your using.
I use the ports to differentiate between certain types of control.
For example I always put touch panel navigation buttons on port 1. The AMX MAX is on Port 4. Lutron Lighting controls are on port 5. My Lutron controls use over 1000 buttons.
The theory is similar to ports on an IP device in that a single box can communicate over different ports simultaneously and in completely different ways.
With separate ports, and separate modules underlying them, you don't have to re-write your entire project whenever there is a device update, or a new device altogether. You just swap modules and change that port appropriately.
I got it
for example, if I have 2 dvd from the same kind, instead of giving new channel codes for every dvd and catch them in seperate code, all I need to do is to give a unique channel port for each of them, and :
1. get them in a seperate code for each dvd
2. make the code handle multiple port
Can anyone show me how to implement the 2 option?
thanks
then you call this module file in the main file two times like this
DEFINE_MODULE mdlDvdLivingRoom(dvTP___1, nDvdChannelCodes,...)
DEFINE_MODULE mdlDvdBedroom(dvTP___2, nDvdChannelCodes,...
the first module will handle all the events coming from your first port, the second all channels from the second port.
ok
how to do it without a modlue use?
I don't have time to move all written code to modules...
Working out how modules work would of course take much longer but you only have to do that once.
[code]
define_device
dvTP1 = 10001:11:0 //device for dvd1
dvTP2 = 10001:12:0 //device for dvd2
dvDVD1 = 5001:9:0
dvDVD2 = 5001:10:0
define_variable
dev vdvTP_DVD[]= {dvTP1,dvTP2}
dev vdvDVD[]= {dvDVD1,dvDVD2}
integer nDVDBtns[] = //put your ordered list of dvd buttons herre
integer nDVDChans[] = //put your ordered list of dvd channels here
define_event
button_event[vdvTP_DVD,nDVDBtns
{
I know how to write modules, I just finished a Kramer module today.
But I have a lot of devices that are not modules, and I don't have time to make huge changes.
I preffer to duplicate the code/make it bigger to handle multiple devices
Ady
P.s
Are you usualy duplicating screens in TPdesign when using duplicated ports?