Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Termination character finding problem

That is hex and I've already explained that as has crossrulz.
0 Kudos
Message 11 of 36
(6,800 Views)
Okay, this is why it's important to be specific. Crossrulz interpreted the A as an ASCII A and I interpreted it as a hex A (ASCII LF). Can you attach the code that is setting the character?

0 Kudos
Message 12 of 36
(6,788 Views)

Can you tell me what will be ascii of 999.

 

Becuase last and max decimal shown by seven segment is 999. I think termination character will be good becuase I will get all data uptil 998.

 

Please tell me ascii of 999.

0 Kudos
Message 13 of 36
(6,782 Views)
That makes no sense.

If you append a termination character, you will get all data if you transmit 9, 999, or 999999, or even abcdefg (as ASCII) and simply specify some very high number of bytes to read.
0 Kudos
Message 14 of 36
(6,777 Views)

Okay how can I know about termination character from coming data in ASCI.

 

I am comunicating with device that shows maximum reading which is 999.

 

Now you have to tell how I will know and add termination character.

0 Kudos
Message 15 of 36
(6,774 Views)
This is getting pretty tiresome.

Ask the developer of the instrument firmware. Second option is to disable the termination character of the VISA Configure Serial Port, read number of available bytes, right click on the string indicator and select 'Hex Display'. Post the contents of your string indicator.

Third option is to turn on NI-Spy/Trace in MAX and do a capture. Post the capture file.

Fourth option is to download portion from Microsoft. Do a capture.
Message 16 of 36
(6,769 Views)

Please tell me that

 

1) How to find termination character  in coming string If I don't know termination character.

 

2) Termination character will come at the end of each and every strings will be same or not. Or termination character will come once at end  after whole string come.

0 Kudos
Message 17 of 36
(6,744 Views)
I am NOT going to repeat myself after telling you 4 different options. Perhaps you need to find another project.
0 Kudos
Message 18 of 36
(6,741 Views)

@Haris115 wrote:

Please tell me that

 

1) How to find termination character  in coming string If I don't know termination character.

 

2) Termination character will come at the end of each and every strings will be same or not. Or termination character will come once at end  after whole string come.


I thought you said you were designing to communication protocol.  So how is it that you don't know what the termination character is?

 

If you are dealing with an instrument and it uses a termination character, they tell you what that termination character is.  The termination character is ALWAYS the same thing for that instrument.  And the termination character is sent at the end of EVERY TRANSMISSION.

 

So, sine you said here that you are making your own hardware, you can define what the termination character is.  You just need to make sure you add the termination character to the end of each transmission.  To be consistant with 99% of the instruments out there, we are recommending you use the Line Feed character, which has a hex value of 0xA, a decimal value of 10.  If working in a C compiler, it is the special "\n".

 

So for example, you need to send "999,500".  What you really need to output is "999,500\n".  Then the VISA Read will stop reading when it finds the line feel character and give you "999,500".


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 19 of 36
(6,738 Views)

Great answer.

 

I want to know that In my case I don't know amount of string come at labview. It might be hundred, thousand or more. 

 

Now my question is that after reading hundred of string and at that time, termination character come and transmission will stop. How can strings after 100 will read because after 100 string might be depended on previous 100 strings.

 

I am confuse in that termination letter come at end of each sting or not????

 

Such as  99,400/n, next string, 23,455/n, 12345/n and so on or 99,400, 23,455,..........................................900987/n??????

0 Kudos
Message 20 of 36
(6,729 Views)