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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stir plate to connect to Labview

Solved!
Go to solution

We would like to use Labview to measure, control, and record stir speed from a stir plate.  Is there a particular type of stir plate that is known to be able to connect to Labview?

 

As background, we currently have a Scilogex MS-7 Pro Digital Magnetic stirrer with an RS-232 port that we have connected to our computer with an NI USB-232/4 interface.  However, NI MAX has been unable to recognize the existence of the stir plate and the manufacturer does not know if the stir plate is SCPI compliant so we are not sure if this stir plate is capable of connecting to Labview.  A software program outside of Labview does recognize, control, and record stir speed from the Scilogex stir plate.

Thank you for your help.

0 Kudos
Message 1 of 19
(3,824 Views)
If the plate connects via RS-232 - then you can communicate to it from LabVIEW.

The communications might use a standard protocol, or it might use a proprietary protocol - in that case you will need to get the manual/documentation (or ask the manufacturer) for the device to understand how the protocol works.

Once you have this, you can implement it in LabVIEW using NI VISA for the Serial communications.

There are some basic examples in the LabVIEW example finder.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 19
(3,819 Views)

This is from the manufacturer --

  • Transmission method: Asynchronous signal transmission in start-stop-operation

. • Mode of transmission:Fully Duplex.1start bit; 7 character bits; 1stop bit.

  • Transmission speed: 9600 bit/s.

 

If you connect your hotplate to a serial port on your PC (COM1, say), you should be able to "talk" to it using VISA.  MAX should also see it once you've set the communications settings appropriately.

 

I didn't find the command structure, i.e. what to send and what to receive to make this unit function.  I don't know why this should be proprietary, but maybe they want you to use only their software ...

 

Bob Schor

0 Kudos
Message 3 of 19
(3,787 Views)

Thanks for the suggestions. We have NI MAX set at 9600 bit/s, 8 character bits, and 1 stop bit with no parity and have chosen the COM port that the stir plate is communicating through.  Is there another setting that needs to be set that I would be missing? 

In the VISA test panel of NI MAX under input/output, I have tried writing and reading to the stir plate either with the *IDN?\n command or with a command given to use from the stir plate manufacturer 0xFE 0xA0 0x00 0x00 0x00 0xA0 which is said to mean "hello" and generate a similarly formatted response from the instrument. In either case, I get the error

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed. Is there any other way to validate that Labview is seeing the stir plate

 

I have also tried entering 0xFE 0xA0 0x00 0x00 0x00 0xA0 into a slightly modified version of the continuous serial read and write vi (modified to account for the stir plate needing a 50 ms delay) and get the same error.

 

Thanks for any suggestions either for this stir plate or any other stir plate that someone has previously connected to Labview.

 

We do have a file with commands from the manufacturer for reading or changing the stir speed and for the response that should be received from the instrument from each of these commands.  However, all we have gotten so far is the timeout error.

0 Kudos
Message 4 of 19
(3,781 Views)

First of all, get it working in MAX.  I noticed that you have the Serial Port set to N-8-1 (no parity, 8 data bits, 1 stop bit).  You are probably too young to have worked with teletypes, but there is a difference between 7-bit Serial (which this device says it uses) and 8-bit.  Try setting 7-bit serial, and all possible settings for Parity.

 

Is *IDN? the command the manufacturer says to give to get the device to "wake up"?  If so, then tell MAX to send it, possibly with \r, \n, or \r\n at the end (Carriage Return, Line Feed, or CR-LF).

 

Bob Schor

0 Kudos
Message 5 of 19
(3,773 Views)

The controller instructions for the stir plate say all the command and data send in a speed of 9600BPS, and N, 8, 1 format.  I know the user manual says 1 start bit and 7 character bits, which I'm assuming means the 1 start bit and 7 character bits combine together to make 8 data bits.  Either way, I've tried setting NI MAX to either 7 or 8 data bits and I get the same error for 7 and 8.

 

0xfe 0xA0 0x00 0x00 0x00 0xA0 is the command given to us by the manufacturer to say wake up. IDN? is the default Labview code for wake up so I have tried both.  

0 Kudos
Message 6 of 19
(3,749 Views)

Hey Alici,

 

I didn't notice in the previous post if you've done a loopback test.  Have you first tried this to make sure the port if operational?

 

http://www.ni.com/tutorial/3450/en/

 

Thanks,

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 19
(3,693 Views)
No, you don't add together the number of start/stop/data bits.

Are you using the correct type of cable for your device? You might need to use a null-modem cable (where the rx & tx lines are cross-linked) or a straight through cable.

I can't open your VI, but are you sending the correct data to the device (e.g. a string set to hex display with FEA0000000A0 in it?).

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 19
(3,682 Views)

The software program from the manufacturer that came with the stir plate can read and control the stir plate without a problem through the serial port connection and cable.  It's only when we try to get Labview to recognize the existence of the stir plate  (even via NI MAX) that we have a problem.  Would a different cable be required to transmit information to Labview rather than the manufacturer software?

 

We are sending the string "0xfe 0xA0 0x00 0x00 0x00 0xA0" to the device in both the vi and NI MAX. 

 

It sounds like the manufacturer has given us inconsistent information in terms of 7 or 8 data bits then.  Always makes things more of a challenge.

 

Thanks for the suggestions.

0 Kudos
Message 9 of 19
(3,668 Views)

The port is operational when we use the software program from the stir plate manufacturer (Scilogex) to control the stir plate.  It's only when we try to get Labview or NI MAX to recognize the stir plate that we have a problem.  I haven't tried a loopback test.  Would that tell me anything that being able to connect to a different software program wouldn't tell me?

 

Thanks.

0 Kudos
Message 10 of 19
(3,666 Views)