Netlinx Buffer
jgreer9514
Posts: 23
I would like the ability to have a Netlinx module have a dynamic device passed into the module. I tried various ways of doing this but the buffer allocation will always attach to the original device passed into the module. I could decalre modules and have the users the ability to choose the type of device on the port not using Duet.
So an API call to reallocation the buffer to the device in Netlinx.
John
So an API call to reallocation the buffer to the device in Netlinx.
John
0
Comments
The easiest way that comes to mind is to create a command protocol and send commands to a virtual device created for the module.
Something along the lines of
send_command vdv_my_vDevice,"NEW_Device_Num:123:1:0
Then in the module you'd parse the string and reference the device with the new values.
It's going to be tricky in that events get ugly when trying to alter devices.
So couldn't in the main program the device number would be a DEV var and when it changes in main code, it changes in the module?
Or maybe, I'm just not quite following . . .
If you have a device declared and passed into the module and change it within your program there is no way to make the module re-sync the buffer with the new device. There is for touch panel events but not for the data event.
=(
If you stay way from buffers and use DATA_EVENT this is easily done.
Ex.
DEFINE_DEVICE
vdvDynVirtual = DYNAMIC_VIRTUAL_DEVICE
Kostas