12-23-2017 10:01 AM
I want to send two packets of data with a few milliseconds pause between them. Like on a picture. But packets send in same time. This did see in "NI I/O Trace" monitor. Enable write buffer to device did not effect.
Solved! Go to Solution.
12-23-2017 11:39 AM
12-23-2017 04:27 PM
What GerdW said plus there is no termination character between the two packets. So it will pretty much look like one long continuous data stream being sent.
You do realize that you are sending the same 8 bytes over and over again (without any termination) until the outer loop stops.
12-24-2017 02:39 PM - edited 12-24-2017 02:43 PM
I did try different baud rates, pauses and packets length. All the same. Packers starts separated after 10ms pause. But not did work on the pause for 3.5 bites transmit time. Like in modbus rtu data.
About termination character. What I understand, it is a bite on the end of packet, but I want use the pause.
Maybe port have any settings about separate|ending packet by time?
12-24-2017 03:11 PM
0Forest0 wrote:About termination character. What I understand, it is a bite on the end of packet, but I want use the pause.
Maybe port have any settings about separate|ending packet by time?
If you are sending the data in an ASCII format (you can read it in a text file), then you definitely should use the termination character. It just makes life so much easier, especially the way most embedded systems are coded (there are commands specifically for reading until a termination character or line). Relying on a pause will give you nothing but headaches due to race conditions on both sides of the transmission.
12-25-2017 06:24 AM
I transmit data in byte format it is shortest variant. Then I don't need termination character.
12-25-2017 05:18 PM
@0Forest0 wrote:
I transmit data in byte format it is shortest variant. Then I don't need termination character.
That is important information. When using a binary/hex/raw format, then the termination character has to be turned off. The termination character could be in the data, which would cause all kinds of issues. Instead, your packett needs to be a set length or have a start character and data length byte or some other way to know the length of the message.
12-27-2017 12:00 PM
@crossrulz wrote:
...a start character and data length byte or some other way to know the length of the message.
This is one way to separate packets in byte transmit mode?
12-27-2017 02:51 PM
What are you even doing? Do you have information on the communications protocol, or are you making this up as you go along? (i.e., are you developing the protocol on the fly?) What does the recipient of these messages do with the messages?
The more questions you can answer, the more specific the help we can give. 🙂
12-28-2017 07:20 AM
@0Forest0 wrote:
@crossrulz wrote:...a start character and data length byte or some other way to know the length of the message.
This is one way to separate packets in byte transmit mode?
Probably not. But it is used pretty much everywhere for a reason. As I stated before, you cannot rely on breaks in transmission. You have to have structure to your data to have reliable communication and packet separation. Either used fixed sized packets (every packet is the same length) or add something to your protocol so the receiver knows how many bytes are in the packet.