NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for prompt with NL&CR

Hi,
 
I'm sending a command and expecting a string ending with the following charachters:
 
3B 0D 0A 3C
 
The string comes in ASCII mode, so that it looks like
 
;
>
 
How do I defined the expecting string to catch that?
 
Thanks
Rafi
0 Kudos
Message 1 of 8
(3,572 Views)
Hi Rafi,
 
I have used this: "\x0D\x0A"
 
Hope this helps
 
Juergen
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 8
(3,558 Views)
Hi Juergen
 
Thanks for your help.  I tried it but it didnot work.
 
In my procedure I send some command and wait for a buffer ending like that..
 
;
<
 
the hidden charchters between the 2 you see on the screen are \x0D and \x0A.
 
 
The question is how to build an expected string to catch this....
 
I tried the following string:   ;\x0D\x0A<, but as I said it didn't work.
 
 
Any idea?
0 Kudos
Message 3 of 8
(3,535 Views)

Hi,

Try holding your string in an array, then use Chr() to convert each value to a character

eg Locals.MyString += Chr(Locals.MyData[RunState.LoopIndex])

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 8
(3,530 Views)

Hi,

if Ray´s suggestion didn't work. (But it should!)
Post a example with your string inside 
so we can take a look on it

Greetings

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 8
(3,525 Views)

Hi Ray,

Your suggestion may be an overkill....

I'm simply looking to detect a prompt.  This prompt always comes at the end of the text and ALWAYS looks like that:

 

;

<

 

My problem is how to use this as an expected string....what to do witht he CR + LF in between the 2 characters?

I tried to look for this  ";\x0D\x0A<"  but it didn't work...

Does your previous answere still applicable?

 

Thanks and Regards

0 Kudos
Message 6 of 8
(3,517 Views)

Hi Rafi,

I have used my stuff to detect a prompt from an embedded Linux serial terminal during bootup. With it  i am able to
so stop and send some new environment variables. So see if Linux was getting the message i will scan my serial
port for this prompt.

Ok I was scanning for LF CR -> but thats the same.

So please send us YOUR comlpete string including the ending stuff in a Local.strString of a TS sequence File, so we can examine it on our TS maschines
to see whats getting wrong.

greetings

Juergen

Add:
I am using TS4.0 !



Message Edited by j_dodek on 07-15-2008 02:01 PM
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 7 of 8
(3,500 Views)

Hi Rafi,

If all you need is to look for "<" then use the Find(). This will return -1 is it doesn't exist and a value indicating its position in the string.

I have attached an example (TS4.0) of the 3b 0d 0a 3C  string, just playing around with it. (I have saved it in INI format so at least you can open this in notepad)

Unless you pop out to something like labview, then you have to resort to tricks to set up strings. (or try loading it using the PropertyLoader).

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 8 of 8
(3,492 Views)