Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Termination character finding problem

Ok, let's take a step backwards.  What exactly are you sending to your computer?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 21 of 36
(6,756 Views)
Yes, termination character comes after each string.
123.5\n
421.43\n
5543.23\n and so on.
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 22 of 36
(6,753 Views)

OKay, I am receiving data such as 123, 24,10 001,..............................990, 1023 and son on.

 

If I append termination character 0xA at each end of string, will the termination letter effect the string or mix the contents of string because it might be that string content will match to termination letter contents??????

0 Kudos
Message 23 of 36
(6,748 Views)

I am sending that data such as 123, 239, 457, 789, 430, 782, so on. But after using convert circuit that I make myself will convert the decimal to ASCII. 

0 Kudos
Message 24 of 36
(6,747 Views)
And whether or not multiple values or a single value is sent is just irrelevant. The only VISA Read would be in a loop so it would be constantly reading and you would simply be appending new data to the old if that was necessary.
0 Kudos
Message 25 of 36
(6,746 Views)

 

 

OKay, I am receiving data such as 123, 24,10 001,..............................990, 1023 and son on.

 

If I append termination character 0xA at each end of string, will the termination letter effect the string or mix the contents of string because it might be that string content will match to termination letter contents??????

0 Kudos
Message 26 of 36
(6,740 Views)
How can you possibly think that the ASCII characters for 0-9 will be confused with the ASCII line feed character? If you are randomly assigning your numerics to random ASCII values, then you need to rethink what your c code is doing.
0 Kudos
Message 27 of 36
(6,731 Views)

@Haris115 wrote:

 

@Yamaeda

 

OKay, I am receiving data such as 123, 24,10 001,..............................990, 1023 and son on.

 

If I append termination character 0xA at each end of string, will the termination letter effect the string or mix the contents of string because it might be that string content will match to termination letter contents??????


This is why I am asking what you are sending.  BE VERY SPECIFIC.  Are you sending ASCII characters the print to be numbers (ei: "0") or are you sending binary data, one character for each number (ei 0x0")?

 

And you are apparently getting data from something else.  What is the protocol the instrument is using?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 28 of 36
(6,719 Views)

The device is sending data in numeric such as 230, 340 so on.

 

The my device will convert random numeric data to ASCII for compatible in Pc.

0 Kudos
Message 29 of 36
(6,716 Views)

So you are recieving 2 bytes from the instrument and converting those into ASCII characters.  I say 2 bytes since you want a value greater than 255.  So after each converted number, you add your termination character.

 

So the instrument sends binary 230 (0x00E6).  You take that and change it to "230\n" (using C notation there).  Then in LabVIEW, you just read something like 10 characters (yes, that is more than you will actually read, that is on purpose).  The VISA Read will return to you "230".  You can do whatever you want with that data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 30 of 36
(6,698 Views)