COM port enhanced options
Fov
Junior Member
Hi there.
I have a DateQ QFM device. I need to control it directly via RS-232, bypassing Musicall matrix.
For this to be done, i have to set enhanced COM port options such as RTS/DTR control, Xon/Xoff chars and so on.
I've made small C++ program able to control QFM via RS-232.
The COM port options I've set:
tDCB.BaudRate = 9600;
tDCB.fRtsControl = RTS_CONTROL_DISABLE;
tDCB.fDtrControl = DTR_CONTROL_HANDSHAKE;
tDCB.StopBits = ONESTOPBIT;
tDCB.Parity = NOPARITY;
tDCB.ByteSize = 8;
tDCB.EofChar = char(136);
tDCB.ErrorChar = 0;
tDCB.EvtChar = 0;
tDCB.XonChar = 17;
tDCB.XoffChar = 19;
tDCB.XonLim = 256;
tDCB.XoffLim = 256;
tCOMMTIMEOUTS.ReadIntervalTimeout = 50;
tCOMMTIMEOUTS.ReadTotalTimeoutMultiplier = 5;
tCOMMTIMEOUTS.ReadTotalTimeoutConstant = 300;
tCOMMTIMEOUTS.WriteTotalTimeoutMultiplier = 15;
tCOMMTIMEOUTS.WriteTotalTimeoutConstant = 10;
The question is: does Netlinx allow to set at least some of these options _for Netlinx Device (~ NI-700) COM port_ or not?
Thanks in advance.
PS: Sorry for my poor english.
I have a DateQ QFM device. I need to control it directly via RS-232, bypassing Musicall matrix.
For this to be done, i have to set enhanced COM port options such as RTS/DTR control, Xon/Xoff chars and so on.
I've made small C++ program able to control QFM via RS-232.
The COM port options I've set:
tDCB.BaudRate = 9600;
tDCB.fRtsControl = RTS_CONTROL_DISABLE;
tDCB.fDtrControl = DTR_CONTROL_HANDSHAKE;
tDCB.StopBits = ONESTOPBIT;
tDCB.Parity = NOPARITY;
tDCB.ByteSize = 8;
tDCB.EofChar = char(136);
tDCB.ErrorChar = 0;
tDCB.EvtChar = 0;
tDCB.XonChar = 17;
tDCB.XoffChar = 19;
tDCB.XonLim = 256;
tDCB.XoffLim = 256;
tCOMMTIMEOUTS.ReadIntervalTimeout = 50;
tCOMMTIMEOUTS.ReadTotalTimeoutMultiplier = 5;
tCOMMTIMEOUTS.ReadTotalTimeoutConstant = 300;
tCOMMTIMEOUTS.WriteTotalTimeoutMultiplier = 15;
tCOMMTIMEOUTS.WriteTotalTimeoutConstant = 10;
The question is: does Netlinx allow to set at least some of these options _for Netlinx Device (~ NI-700) COM port_ or not?
Thanks in advance.
PS: Sorry for my poor english.
Comments
-
you can use the 'SET BAUD' commando.
SET BAUD <baudrate> <parity> <databits> <stopbits> <485 enable/disable>
you can also use HSON/HSOFF to enable/disable hardware handshaking (RTS/CTS) and enable/disable software handshaking
is that enough? -
Thaks for your reply

I'll try that today. -
Problem is solved. Thanks, yuri.
I've made the following to get it done:
SEND_COMMAND DATA.DEVICE, 'SET BAUD 9600, N, 8, 1'
SEND_COMMAND DATA.DEVICE, 'HSON'
SEND_COMMAND DATA.DEVICE, 'XON'
Another question:
I have to count sum of two bytes and take the low byte of resulting word. In C++ it can be done easily:
Res_Byte = LOBYTE(MSB+LSB);
How can I do the same thing in NetLinx?
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums