Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read gives Garbage Values

Hello,

 

When i try reading SR830(Lock In Amplifier) with the code attached,i find it reads Garbage vallue.

HOw to fix it??

 

Pls guide.

 

 

Download All
0 Kudos
Message 1 of 6
(4,432 Views)

1.  It looks like your instrument is sending a termination character.  Therefore, do NOT use the Bytes At Port.  Instead, use a constant to tell the VISA Read to read more than the longest message you will recieve.  The VISA Read will stop when it encounters the termination character.

2. It looks like the termination character is actually /r (hex value 0D).  So you will want to set the termination character to that (done with the Configure Serial Port).

3. You will want your read to be done in a loop since it looks like you are getting many messages from the instrument.  I'm guessing the instrument is streaming its 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
0 Kudos
Message 2 of 6
(4,423 Views)

Thanks for the inputs.

 

I tried the solution suggested by you.

I removed "Bytes Read" to a constant higher than the actual value,even then i get the same response.

0 Kudos
Message 3 of 6
(4,416 Views)

I just noticed that you are using the SR830 driver already.  What is wrong with using the Initialize VI that the driver supplied?


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
0 Kudos
Message 4 of 6
(4,412 Views)

The driver supplied is for GPIB.I am converting it to Serail(RS232).

I always get error in Initialise Vi,so debugging with the changes already posted.

 

I have another generic Question.The SR830 driver was downloaded to the link C:\...\LV\instr.

I am using these Driver in my Vi and making changes locally.I see that the Original in C drive is also changed when any changes are made locally.This is tough as when i wanted to refer the original,it is no longer there.

 

 

 

0 Kudos
Message 5 of 6
(4,410 Views)

I have attached my code for Initialise block.Can you please correct the bugs in it,if any as i always get error here.

 

TIA

0 Kudos
Message 6 of 6
(4,391 Views)