From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Having problem with simple serial communication

Hello,

 

I read but wasn't sure about it. Let me try. Thanks for instant help. 🙂

 

Regards

Anupam

0 Kudos
Message 11 of 17
(1,287 Views)

Hi Dennis,

 

I have tried as you told. The write  operations are working. But during the read there are some kind of Framing Problem. I ouldn't solve this. & Also I couldn't find anything how to convert the strings that I am receiving to some meaningful words. Could you suggest how to do that? I am not familiar with code writings so I have a very little knowledge about the characters that I am seeing. & There is another things, when it shows the data on the read string, it shows different length of data for the same operation at different trials. I couldn't decipher it. 

 

Regards

Anupam

0 Kudos
Message 12 of 17
(1,267 Views)

Well, you don't know for a fact that there isn't error on the write.

 

Double check that the com parameters you set are the same as what is in the manual.

 

You should be reading the same number of bytes over and over again. Make sure the termination character is enabled. Set the number of bytes to be something greater than 32 (i.e. 100). The VISA Read will automatically terminate when the term character is seen.

 

The format of the data is explained in the manual. If you need help, attach some example strings along with the thermocouple values that the instrument is displaying.

0 Kudos
Message 13 of 17
(1,262 Views)

Hey,

 

I just tried to communicate with the codes as before & I am attaching what I  see. "C" is thecommand for switching the ferhenheit to degree centigred and otherwise. So when I am reading the strings back, there are different lengths of it for the same command. I thing I figured out is that the last three digits are showing the clock on the thermometer. So others should be from the same digital display. I am not getting any idea to see how things can be distinguished.

 

Regards

Anupam

0 Kudos
Message 14 of 17
(1,248 Views)

I see you're getting a framing error. Have you seen this document? http://digital.ni.com/public.nsf/allkb/13A20C0F9DF265FB86256FC60066D9C2?OpenDocument It might help. 

Product Support Engineer
National Instruments
0 Kudos
Message 15 of 17
(1,238 Views)

Hello,

 

I have seen that & I already have the settings matched with each other. Please see carefully into thee diagrams. The bytes recieved should be the same for same operations. But it comes out to be different in each cases. I don't know the reason.

 

Regards

Anupam

0 Kudos
Message 16 of 17
(1,236 Views)

Did you set the termination character as Mr. Knutson suggested? The fact that you're getting a different amount of information back would seem to indicate that your settings do not match. Particularly given that your program is throwing a framing error.

Product Support Engineer
National Instruments
0 Kudos
Message 17 of 17
(1,227 Views)