Problem to talk to an instrument using rs232
Hello,
We are trying to communicate to a ROD-4 (instrument) by using an rs232 link. We have a program from rod-4 on pc and this communicates with the instrument(--> rs232link is OK I suppose) but we can't program everything we want. Therefore we will use Labview to communicate with the instrument(Rod-4). We have made a VI to communicate with the ROD-4 but it doesn't work. Do you want to check the VI I have made to communicate by rs232. Check also the rod-4 maual.pdf on pg 8 and 9, there is standing which program language the rod-4 knows (ascii protocol). The machine(rod-4) answers in the string read with:'' ?\n\r ''what dus this means?
(Using win98se with Labview 5.1)
Thanks.
Attachments:
Bureaublad.zip 101 KB
One problem is that you're not sending the stx control character (hex 02). You're sending the text "s", "t", "x". I've attached a picture of a modified VI that should work. Note that I replaced the serial functions that you're using and used VISA commands instead. I'm also curious about something. You said you're using LabVIEW 5.1 but the VI you posted is version 6.1.
Attachments:
serial write.jpg 17 KB
Similar Messages
-
Control Instrument using RS232 port
I have tried to download the IVI driver of the Agilent E3633A that stated can communicate using GPIB or Serial.
I tried to initialize the instrument but no successful.
I used a twisted ( tx and rx swap) RS232 cable (female to female) to connect between the instrument and PC com port.
Please help to advice on how to control the equipments using RS232 port inlabview. Thanks!Hello,
Here's what you can do to verify that you have established communication with the instrument.
First gather the relevant information:
1. Find a command that you know your instrument "understands" (it is highly likely that it will understand *idn? which should prompt the instrument to reply with a description of itself).
2. Verify the serial settings that your instrument uses by default, such as baud rate, number of data bits (likely 8), parity, and the number of stop bits. You can also verify what termination character the instrument uses (which it likely does); this is the last character you will need to send after sending the relevant command characters, and it will indicate the end of the command to the instrument so that it stops reading from the serial port. I doubt that the instrument is configured for flow control of any kind by default, so don't worry about that unless there is specific indication of this in the manual for your instrument.
3. Verify the type of your cable; that is, you will need to connect pin 2 of your computer's COM port to pin 3 of your instrument's COM port, and pin 3 of your computer's COM port to pin 2 of your instrument's COM port. Some cables automatically switch these connections with the wires inside the cable, others are "straight through." You can bypass the cables altogether and just use wires to make the relevant connections initially; don't worry about a twisted pair at first, just keep the wires short and you should be ok (unless you are in a particularly noisy environment).
Now build the LabVIEW program:
1. Open a blank VI
2. Navigate to and pin down the following functions palette on the block diagram:
All Functions -> Instrument I/O -> Serial
3. Place onto the block diagram the four VIs/functions in the top row in the order they appear (should be VISA Configure Serial Port, VISA Write, VISA Read, VISA Close); note that the open will be performed implicitly the property node inside the VISA Configure Serial Port VI (don't worry about this).
4. Hover over the upper left hand terminal of the VISA Configure Serial Port VI, right click, and choose
Create -> Constant; now select the PC COM port you connected your instrument to in the newly created constant
5. Create constants for the inputs to match the serial parameters that you found for your instrument above if the default values don't already match. Note that the defaults used by this VI include activating the linefeed termination character to be used when reading, as well as standard settings for serial port which may already match your instrument (check by hovering over the ports with the wiring tool; the default values will show in parenthesis)
6. Wire the top right hand terminal to the top left hand terminal of adjacent VI's (which should be in the order noted above); this connects the resource name to each so they perform the operations on the chosen serial port
7. Wire the bottom left to the bottom right hand terminals in a similar fashion; this connects the error clusters
8. Almost done... now hover over the remaining left input of the VISA Write function (called write buffer), right click, and create a constant; type *idn? (and include a linefeed character at the end by typing the key)in the string constant that you just created
9. Similarly for the read function, create a constant for the input that indicates the number of bytes to read (perhaps make this number 100 as you will likely terminate the read appropriately when a termination character is read; your instrument will likely send this), and create an indicator for the "read buffer" output which will show you the string that is read back when you run the program.
10. You should now be able to run the program; hope it works.
I would have included a screenshot or example instead of a description, but I don't have access to that at this time and perhaps it is best to actually go through the process of building the VI anyway if you are new to LAbVIEW.
Good luck and repost if you continue to have troubles!
Thank you,
Best Regards,
JLS
Best,
JLS
Sixclear -
"hi....
I've ever controlled some instrument by GPIB interface using Labview 6.0...it's really easy to implement .....but the problem is that i hvae to control those instrument under the pure DOS environment now ..so i have to abandon the using of GPIB interface and Labview ....then i choose the RS232 interface with programing the Borland C++ v3.1 and sending the SCPI command by bioscom()....but it got no response at all......so i am wonder if i can control those instrument by using RS232 interface and Borland C++ v3.1 to implement a pure Dos program????if yse,how can i do and is there any sample can be refer to ????
thank you for you help"Hello Alvin-
We do not have any sample code for programming RS 232 in C on our website. However, you may want to looks at these links for general troubleshooting tips for serial:
Serial Communication Starting Point
How to Do a Serial Loopback Test
Regards,
Ray Kong
NI Applications Engineer -
How can I control instrument using its RS232 port in VB or VC++?
1)How can I control instrument using its RS232 port in VB or VC++?
2)What's the module or .h file need I add-in to VB or VC++?
3)Can you provide me some easy examples for that?
Thanks!Kevin,
I've used Measurement Studio - Tools for Visual Basic and Tools for Visual C++ (ActiveX component) for instrument control.
I've used both the VISA and non VISA versions and they are pretty straight forward to use for GPIB, Serial or VXI.
You might find the following page useful.
http://www.ni.com/mstudio/cworks.htm#ICC
Regards,
Kamran -
Hello,
I'm trying to use a Prologix USB GPIB controller to control GPIB
instruments, and I would like to have a virtual serial (VISA) port for
*each instrument*, as is the case with a normal GPIB controller with a
standard NI driver. However this is not what the Prologix driver
provides -- it provides a single VISA virtual serial port for the
entire controller. To address the instrument with GPIB address 11,
you first send "++addr 11" to the serial port, and then you're talking
to instrument 11. However, this means I have to change all old
Labview programs.
Is it possible to create a "wrapper" function of some kind that will
define a virtual serial (VISA) port for each *instrument* on the
controller? For example, to talk to GPIB instrument 11, call it
ASRL3::11::INSTR, each time it is written to it would have to write to
the virtual serial port of the controller, say ASRL3::INSTR, first "+
+addr 11" and then the command that is sent to it.
A clearer explanation of the difference (i.e. incompatibility), and of
my objective:
1) A normal GPIB controller with NI driver: I go to the NI
Measurement & Instrumentation Panel, under GPIB, and Scan for
Instruments; all the live instruments show up; subsequently when I
want to use Labview programs that use VISA ports, the VISA drop boxes
allow me to choose a different port for each instrument, e.g.
"GPIB0::11::INSTR", "GPIB0::12::INSTR" would be instruments at
addresses GPIB 11 and GPIB 12.
2) The Prologix GPIB controller that plugs into a USB port: In
Labview you get a *single* VISA virtual serial port, ASRL3::INSTR, for
the entire GPIB0 controller. Therefore to address GPIB instrument 11,
you write "++addr 11" to the virtual serial port ASRL3::INSTR, and
then you are communicating with device 11, so you can write and read
ASRL3::INSTR to talk to that device. Then to talk to device GPIB 12,
you write "++addr 12" to the same VISA port, and then you are talking
to that device. The problem is that this requires recoding all
Labview code, whereas I would like to be able to use the same program
either with a normal or with a Prologix GPIB controller. Therefore, I
would like to create code that scans the controller for all GPIB
attached devices and creates VISA ports for all. Such ports, when
written to, would have to first write "++addr DEVICENUM" to
ASRL3::INSTR (i.e. the port of the GPIB-USB controller) where
DEVICENUM is the GPIB address of the instrument corresponding to that
port, and then would have to do a write or read or whatever function
is being done on that instrument VISA port.
I haven't figured out if it is possible to do this easily. Help and
pointers on where to look for hints would be much appreciated. Many
thanks!
MilosMy first impression is that if you don't want to make any changes at all to existing programs is that the wrapper you need is one around VISA. You would need to intercept all of the calls into the NI VISA driver. If you create your own visa32.dll and in there, change the addressing and then call the real VISA driver, you might (repeat, might) get something to work. If this would even work, you still might find that you have to make significant changes anyway. The serial connection is going to be considerably slower, and interface specific functions such as service request handling, bus triggering of multiple instruments, etc., would be difficult to impossible. This would be a lot of work, imho, to just save a couple of hundred dollars over a real GPIB controller. I've seen this Prologix device before and have even used NI's RS-232->GPIB controller. The Prologix intended use to me seems to me more for a hobbyist or very casual user. Of course, I'm used to having multiple GPIB instruments worth 10s/100s of thousands of dollars and the cost of an fully compliant GPIB controller is just lost in the noise.
-
Hi-
I have successfully used RS232 library to communicate with one RS485 device. I now have multiple devices using the same Rx and Tx lines. Three of the 4 devices have their own dll and can communicate effectively despite each other. My problem occurs when the one device I am talking to using the RS232 library now has to share the lines with the other devices. Are there any ways around this? All I can think of is to see if I can use the NI Serial library commands with my non-NI PCIe card. OR, buy the NI 485/422 card and use the NI Serial commands. Any other suggestions?
Thanks.The fundamanetal difference between RS232 and RS485 is the ability to connect to multoiple devices. The devices also normally work in a "speak only when spoken to" mode and this is achieve by adding a device address in the protocol. The NI serial library is oblivious to most of this and doesn't care if it's RS232 or RS485. The problem with your 232 device is that it will speak everytime when any other device is adddressed, so you should make it comply to 485 standards. This can be done with RS232 to RS485 convertors. You can do a search on Google for this. The ones I use and have the least amount of problems with is either from Advantech (<http://www.advantech.com/products/search.aspx?keyword=RS-232#search> and <http://www.advantech.com/products/search.aspx?keyword=RS-232#search>) or BB Electronics. (<http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Converters/Port-Powered-RS-232-to-RS-485-...>)
Best Regards
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd -
Problems with access to serial port using reentrant code
Hi,
I have a VI that send commands and receive answers from an instrument using
de serial port.
This VI runs perfectly when used alone.
However I'm trying run two instances of that VI simultaneously using
reentrant code and I'm facing some problems.
Sometimes everything is OK but sometimes, in the process of writing to
serial port the following error happen:
Error code 36.
Invalid refnum device.
What is this?
Does someone know how to prevent this?
Thanks in advance for any help."Paro, Paula [CMPS:2721:EXCH]" wrote:
>
> Hi,
>
> I have a VI that send commands and receive answers from an instrument using
> de serial port.
> This VI runs perfectly when used alone.
> However I'm trying run two instances of that VI simultaneously using
> reentrant code and I'm facing some problems.
> Sometimes everything is OK but sometimes, in the process of writing to
> serial port the following error happen:
> Error code 36.
> Invalid refnum device.
>
> What is this?
> Does someone know how to prevent this?
>
> Thanks in advance for any help.
You can't use reentrant vi's vith serial vi calls without supervising of
driver.
Use VISA instead and you have to control the VISA session opening and
closing. Another word is that the only one serial port sess
ion should be
opened at a time.
Reentrant vi's for serial port without checking serial port session is a
mistake of program algorithm. Change it in any convenient way.
Sergey Krasnishov
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
[email protected]
http://acs.levsha.ru -
How do I get my iPod to talk with my iMac using FaceTime?
I know it's going to be something annoyingly obvious, BUT, how do I get my iPod to talk with my iMac using FaceTime? Both appear to work just fine with other emails, have made calls out to others using email addresses with both the iPod and the iMac. Have recieved calls from others on both iPod and iMac using phone numbers and email addresses. Just can't call my self as it were. Both the iPod and the iMac use the same email address, is this my problem? How do I get it work? (it's for my daughter so she can talk and see her mother when she under goes cancer treatment).
Yes, having the same FT calling email address is the problem. It like trying to make a phone call to your your phone from your phone.
On one device add another email address for FT and then uncheck or delete the Apple ID email address the Apple ID call email adddress on the device.
On the iPod go to SettingsFaceTime>You can be Reached At -
Many new PDAs have USB cradles only. Can someone recommend a good configuration (PDA, OS and any options) that worked for Labview PDA to control instrument through RS232?
I don't have a lot of experience with various PDA models but I'm using a Palm OS Tungsten T5 to do serial communication. I did have to buy a cable that converts the TTL level RS232 to as "true" RS232 level. Once I got that it worked rather well. As far as I know most Palm PDAs have RS232 coming out of there sync connector. You just have to do some digging or call the manufacturer to get the right info.
Don't drive angry. Don't drive angry! -
Control Temperature of WATLOW using RS232..Got vi ? to begin with?
Looking for vi which can help me conrol the temperature inside my little chamber (WATLOW) using RS232 port
If you are looking for generic serial example programs, go to Help»Examples»I/O Interfaces»Serial»LabVIEW<->Serial. Enter the com port and set both dip switches in the up position.
If you are looking for a instrument specific driver, you may want to contact the manufacturer to see if they have a LabVIEW driver for their instrument. If they don't, you can easily create a low-level driver by configuring an I/O assistant VI for each function in the manual. I/O assistant is one of the many new features of LabVIEW 7 and will parse instrument responses for you, which makes creating an instrument driver much easier. Once you have this low level driver you can just combine functions to make higher level VIs. -
Problem linking Outlook to Ovi suite - using Nokia...
Hi,
I bought Nokia N8 and tried to sync my Microsoft Outlook contacts and calendar entries using Ovi Suite. Unfortunately, I get the following message in both cases on Ovi suite
"Reinstall Microsoft Outlook. Then sync again".
Once I also noted the error code "83860077".
I contacted the help line but I have to say that I was totally disappointed.
They let me delete one DB file hidden in the folder but this didn't help either.
Also,
- I installed Microsoft office again (I am using Microsoft Office professional 2003)
- I removed all Nokia programs from my PC and then installed the latest version Ovi suite 2.2.1.23
However, the problem still remains.
I am using Windows XP as OS.
Connection between Ovi suite and Nokia N8 phone looks good (e.g. photos, messages).
Can anyone help here?
I am really disappointed and clueless to solve this issue.
Thanks,
KapsI've just spent the last two weeks, since picking up a brand new N8-00, trying to get it to sync with my computer, home WiFi, and earpiece. Despite being told by the help line people that the earpiece bluetooth wasn't compatible, it has now recognised it. I've had to re-boot my router several times a day fo several days before the two machines finaly agreed to talk to each other.
All that now remains is getting Ovi Suite to talk to Outlook. I've reinstalled it several times, including wiping the registry clean of anything to do with Nokia. I'm now waiting for their IT team to get back to me with a solution. I have a similar problem: Whenever I try to sync Ovi with Outlook 2007 in Windows 7, either Contacts or Calendar, the programme simply freezes and refuses to work. Eventually I get the message that it has stopped working and suggesting I let Microsoft know about it.
I've spent to last few days on the phone badgering their support department, perhaps if this problem was reported to them by more people they might get round to doing something about it.
I am interested to hear that Ovi 3.0 appears to work, but would be reluctant to try it without more confirmation.
So far I am not impressed by Nokia. It's a pity, as the phone seems to be a good one, it's just let down by shockingly poor software, but with a few tweeks it could be outstanding. -
Problem with flash on IE11 after using adobe cleaner
Problem with flash on IE11 after using adobe cleaner to remove a trial version of photoshop because there was not any entry on add/remove applications in windows 8.1
Its to frustrating to reinstall everything. I tried everything from your support page with no luck…Link for Download & Install & Setup & Activation problems may help
-Online Chat http://www.adobe.com/support/download-install/supportinfo/ -
Problem regarding the creation of Table using CSS.
Hi ,
Here I have a Problem regarding the creation of Table using CSS.
In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
width:900px;
height : auto,
Overflow : visible,
Max-height: : 200px.
If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
Thanks & Regards
MadhaviHey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?
-
I purchased my Macbook (17") through a certified apple tecnition in August 2012, it was refurbished and the motherboard was completely replaced. I do a lot of photo editing, but I have been unable to do so because of the red vibrating lines that interrupt my screen. The issue disappears temporarily when I tap on the computer, and the problem does not occur when I use external display or try to screen capture the problem. I brought the computer back to the technition I purchased it from and he said that it was a problem with my fan, so I have two new fans but the issue is still occuring. He says he doesnt know whats wrong. Does anyone have any information on this issue?
Here is an image of the issue
http://www.flickr.com/photos/67839707@N08/8884847081/I recommend having your Mac serviced by someone competent. A force sufficient to "blow apart" the fans was clearly excessive and may have damaged the display cable, as well as any number of other problems.
Dust is properly cleaned with a vacuum, preferably one designed for computer service, and they are not cheap.
Compressed air should never be used. It just blows dust everywhere, often into places where it can no longer be removed. -
I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. And some contacts occasionally have problems opening files sent by me using Mail too. This was never a problem on pre-Intel Mac. A real Mac **** up ! Any ideas ?
Can you drag and drop the attachments visible in the email to the Desktop OK or does that fail ?
Re the sending: Are these recipients on Mac's or PC's as the file type could be an issue, if on Mac's then try setting the Mail Preferences Composing setting to Plain Text not Rich Text and see if that improves things.
Maybe you are looking for
-
Windows 7 64bit and itunes 10.5 "itunes has stopped working"
itunes suddenly stopped working yesterday. I updated to the latest version. I started itunes and as it was opening and showing messages such as "reviewing library" and "genius starting", I received a message that said "itunes stopped working"...closi
-
Query not using aggregate when written against multiprovider
We have a multiprovider that contains one infocube. The infocube has aggregates defined to it. When writing a query against the infocube, an aggregate is used. However, when writting the identical query against the multiprovider, an aggegate is not u
-
How do I uninstall completely Logic Pro 8 ?
-
Can 32-bit plugins remain in plugin folder and not crash Logic?
Pre-sales question: 1) If you have any 32-bit plugins in the plugin folder, can they just be disabled in the Logic X AU manager, or do they crash Logic X upon launch? The reason I ask is because I wanted to keep some in the folder for when I use anot
-
Weblogic.transaction.internal.TimedOutException while JMS adapter De queuing
Hi , I am getting the weblogic.transaction.internal.TimedOutException in SOA logs, when i track the instance using ecid. I am unable to find the flow in EM. EM shows that instance as complete and I can able to see only the JMS adapter in flow trace.