Ltc
Niccol?
Posts: 10
Hello AMX World!
I have an machine AV-TC 60 RLV alpermann+velte that LTC reads and it converts in hex code.
the NI3100 does not see the data in RX, while if I connect AV-TC 60 RLV at PC I can read the strings.
can you help me?
bye
I have an machine AV-TC 60 RLV alpermann+velte that LTC reads and it converts in hex code.
the NI3100 does not see the data in RX, while if I connect AV-TC 60 RLV at PC I can read the strings.
can you help me?
bye
0
Comments
The following things should be in your code:
Without the CREATE_BUFFER declaration, you will not see the RX light turn on even if data is coming in your port. Also verify that TX and RX lines from your device are wired correctly.
- Chip
Respectfully, the CREATE_BUFFER routine has nothing to do with the RX light working or not. I haven't used a CREATE_BUFFER since NetLinx came along. I would code it:
DEFINE_VAR
MyDevStr[255] // Change the size as needed for the amount of data that comes in from your device
DEFINE_START
DEFINE_EVENT
DATA_EVENT [MyDev]
{
ONLINE:
{
SEND_COMMAND MyDev,'SET BAUD 9600,N,8,1'
// Adjust this to match the needs of your device
}
STRING:
{
MyDefStr = ' ' //clear the string every time data comes in
MyDefStr = data.text
// code here will be triggered EACH TIME new data comes in the RS232 port
// you should run a routine here that examines MyDevStr for data you need
// and parse what you need out of the string
}
}
Danny you are correct, too.
Prior to the NI-2000 series, the RX light would work no matter, as long as the baud was set to 9600 baud, without any intervention. I neglected to put that in my response, so it's an incorrect statement on my part because the CREATE_BUFFER does initiate the 'RXON'.
I understand that around that time the NI-2000 series came out, AMX turned 'RXOFF' on new units to keep strings from flooding the masters and UART buffers unknowingly.
Crazy, how things change!
It seems likely to me that the OP's problem may be due to the master starting up in receive off. It's a common enough occurrence and it seems to pop up here about every month or so. I even discover it for myself about once a year, but that may be a specific gravity problem.
Eliminating the create_buffer stuff seems cleaner, and it's what I do also, but some folks have discovered that the buffer for data.text may not always be big enough. I think the situation involved processing a large amount of information from a website and overflowing the buffer. Probably a rare problem, but it is a time where the create_buffer would work and the data event string handler would not.
It doesn't happen very often and I can't recall the equipment (it may have been a little IP to RS232 box), but occasionally, data.text will hold either more or less than a complete serial transmission. Technote 616 discusses this and there have been some nice solutions posted to the forums as well.
for help me, therefore effective and fast.
bye
Hedberg is correct, you cannot trust the data.text will have a complete message from a serial device. Serial depending on the baud rate sends 8 bits at a time. The string event may trigger multiple times before the complete message has been received. DATA.TEXT gets cleared each time the STRING event is called. Example 1 is one solution, but concatenation we have found, takes more processor time then actually using CREATE_BUFFER. Example 2 uses a CREATE_BUFFER statement. STRING events also cause the RXON command to be sent. So Chip's method is prefered.
I apply your metod and now I read correctly the string! I insert an clear_buffer every time I recive a string!
thanks all!
bye or CIAO!