LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication

Sorry, forgot earlier to ask how to get a screenshot of hyperterminal for Dennis.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 11 of 96
(2,957 Views)
If it's not in the manual, then you had better call the vendor and get the information. There's so many possiblities with serial communication, it's pretty hard to get it right by experimentation. You also need to know whether the instrument is a DTE or DCE device. Do you have an electronic version of the manual you can post or a link to one?
0 Kudos
Message 12 of 96
(2,302 Views)

Hi,

Just want to add one thing to what Dennis said, If the data your receiving is not plain ascii disable terminate char in the VISA open function. Otherwise, the read data function stops at the first 0x0A character.

Like Dennis said first see how many bytes there are available (with a timeout) before reading the COM port.

 

See my example. Forget all the blue VI’s and look into the red square. This while loop waits for 1 second or if there are 6 or more bytes available at the COM port.  Also look at the VISA open at the beginning. If things are OK I expect 6 bytes if it’s not OK who knows. In this way I always get the data if there is any without a hang-up situation.

Needles to say that the 1 second is time-out is valid for my application.

 

 

KC

 

 

 

 

 

 

 

0 Kudos
Message 13 of 96
(2,281 Views)
What is the device and part number that you want to read from?? There is probably some info already in the discussion forums or google.
0 Kudos
Message 14 of 96
(2,270 Views)
Wow
Looking at your code you have not established communication with your instruments before you attempt to read a waveform Smiley Mad

Sorry for saying it but you appear to be trying to run a marathon before crawlingSmiley Surprised

A suggestion ::Smiley Happy
Start a fresh -- estabalish communications with your instruments  first
HAve you found any drivers for them ?
( What are they actually)

Have you read the actually Labview manual with regard to wiring ? In a nutshell you shouldn't cover more than one screen ( monitor ) with wiring  - sub vi's help.

If you post the instrument  names or manuals , possible to go forward

lets go for it

xseadog


0 Kudos
Message 15 of 96
(2,259 Views)
OK. I am going to reply person by person, so bear with me. Dennis, hot do I tell if it is DTE or whatever the other is? I was given the cables and the very beginnings of a VI and told to run with it, so I don't know a lot about this. (BTW, the Tektronix part was not written by me, but it is the only part that runs on my computer)

KC- I do not get any data. I don't think that has to do with whether it's ascii or not. I will look into your VI, however, once i get it transferred to a comuter that actaully has Labview so I can look at it.

Unclebump- I am actually tring to read from several devices they are as follows. An Omega MDSi8 Temperature Controller, an MKS 600 Series Pressure Controller, an MKS 247 Four Channel Readout, an MKS 937A Gauge Controller, and a Dressler Cesar RF Power Generator. I know that at least the Omega Command is correct. On that I have also confirmed that the settings are correct (it has been my test device) and it still doesn't work. I have called them three times and they told me that is it. Some of the manuals actually do not have commands in them, despite having RS-232 outlets on them. I have called the company, butthey have been... less than cooperative. I shall look here for some of them, but where on the forums would it be?

xseadog- Yeah, I agree with the Marathon comment. Teaching yourself Labview and having your advisor expect you to write something like this is a tad...... insane? I honestly do not know how to make or run a SubVI and do not have the Labview manual. It is a departmental liscense, and I only had access to it in the early stages of my learning. I have tried communicating with the devices on smaller, seperate VI's and it still doesn't work. I have drivers for the DAQ card, and it seems to work fine, butfrom what I understand, the other devices do not need drivers, they should just be able to be written to and read. Is this reasonable? What do you mean about "not establishing a connection between devices before trying to start the waveform? Where is that? That could be the problem I am looking for.

Thanks to you all for your patience and aid.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 16 of 96
(2,246 Views)
So I tried KC's VI, but couldn't open it. It is Labview 7.1, and I have7.0. Would you mind posting an image of the block diagram so I can see it?

Thanks again.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 17 of 96
(2,242 Views)

Okay, now we're getting somewhere. DTE stands for Data Terminal Equipment which usually means a computer, and DCE stands for Data Communication Equipment like a modem. When you connect DTE-DCE, you use a straight through serial cable. Pin 2 of the DB9 at the computer connects to pin 2 of the modem, pin3 at the computer to pin3 of the modem, etc. Many instruments are implemented as DTE which means you use a null-modem or cross-over cable to connect from the pc to the instrument. Pin 2 at the computer (Tx) gets connected to Pin 3 (Rx) at the instrument and Pin 3 at the computer (Rx) gets connected to pin 2 (Tx) of the instrument. For your loopback test to work, this is how you had to have the cable wired to go between com1 and com2. If you just did a loopback test on com1, then you just wired Tx to Rx at the same port. I did a lookup of the MDSi8 and it has a wiring diagram for the cable between pc and instrument. It is a straight through wiring scheme. With an ohm meter, check the wiring of the cable you're using. Every wire at one end should have continuity to the same pin at the other end. I hope you find that the cable is wrong and once you get the correct cable, you can use Hyperterminal to talk to it. I haven't tried to find the manuals for the other instruments but I wouldn't be surprised if you have a similar problem with them.

0 Kudos
Message 18 of 96
(2,230 Views)
OK, I am at home now (it's 09:00pm) so I used the VI from my message and modified it. I tried to save it as 7.0 but not all VISA could be saved so i am not sure if it wil work for you. I included a screenshot.
Hope this will help you together with all the other good suggestions.
0 Kudos
Message 19 of 96
(2,231 Views)
Hi JohnGalt
noticed that your serial ports are designated as com 13 and com14 !!
 Is this because you have so many ports? Or what ?
Has your PC machine any serial ports ? ( not added cards)  If so  I would suggest you utilise that first  as
it would mean you are not using any 'extra'drivers to communicate with instruments. Once proven then of course one could then estabish coms via the extra ports.
I have downloaded the comms  + mdsi8 manual from omega- just quickly skimmed it , noticed that you can set up direct from front panel of instrument.You can also adjust comms speed- default is 9600 baud.

For first assignment  - connect Mdsi 8 to PC  via serial cable. Switch on  adjust comm parameters manually so that speed is not 9600 ie 19600 baud.
Enable your serial coms via labview - initialise to your set baud rate. Now send the following command

are you ready ??  ( no not this line Smiley Tongue)
 (this one -after brackets)  Z02 
which is actally a hard reset. So now if you check your baud speed manually if it is 9600 then you have suceed in establishing coms between PC and instrument.

go for it
xseadog
0 Kudos
Message 20 of 96
(2,224 Views)