Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

mks 647c control

Hello,
Has anyone done the control with mks instrument 647c ?
I found the driver on the website, and run contained VIs.
The communication port is COM3, and shows no errors at all.
But I can only read the data such as pressure, date, channels... from the instrument.
Once I try to write something like baudrate or word bits into the instrument, it still shows no error,
but there is no any change of parameters in the instrument.
Can somebody share any experience or suggestions for me ?
Thanks!
 
The driver from followed website:
 
 
0 Kudos
Message 1 of 21
(7,255 Views)
I'm not sure I understand what you are trying to do. I downloaded the driver and the only baud rate/data setting is in the 647 Initialize VI. This sets the pc's com port and would disable communication with the instrument so of course, none of the commands you send will work. Because it's a serial port, you won't get an errror until you try to do a read and nothing comes back.
0 Kudos
Message 2 of 21
(7,245 Views)
Hello Dennis,
 
Thanks for your reply.
Actually, first I just want to initialize the instrument.
What I did was using that initialize.VI and tried to initialize the instrument.
The problem was as you mentioned. It shows no error, but the set baud rate can't be written
into instrument.
On the other hand, I also tried other VIs which can read data from instrument, and
it actually read something successfully.
 
Can you help me about how to initialize the instrument from that initialize.VI ?
Which parts should I modify ?
 
Thanks a lot!
0 Kudos
Message 3 of 21
(7,227 Views)
As I said, the initialize function sets the com port of the pc. It does NOT set the com settings of the instrument. Look at the code in the function. It does nothing to the instrument. The only purpose of the function is to create a VISA session and initialize the pc's com port to mathc however you have set the instrument's com port. To change the instrument's com settings, you will have to refer to the instrument's manual and determine how to do that. Then you would use the intialize VI to match those changes. If you are able to use other functions in the driver, then everything is initialized.
0 Kudos
Message 4 of 21
(7,222 Views)

Hello Dennis,

Thanks for your reply.

As you said for the initialize.VI, for example, if I set com port of the pc to be COM3,

I have also to set the com port of the instrument as COM3 so they can communicate

with each other. However, since I can read the either date, time, or pressure from the

instrument through example 647 read ID.VI of the driver, that should mean the

communication of pc and instrument successfully, right ? What I have to do is adding

the VISA write into the initialize.VI so the baud rate data can be written into instrument. Is

this correct ? I check the instrument. There is no place where I can set the com port.

The manual has some example in POWER BASIC as below:

The following examples show the usage of a 647C through the RS232 interface. The examples are
given in Power BASIC.
Program to display the act. flow of channel 1:
10 OPEN “COM2: 9600, 0, 8, 1” AS #1
20 PRINT #10, “ID”
30 INPUT #10, A$
40 PRINT A$
50 PRINT #10, “FS 1 0500”
60 PRINT #10, “ON 1”
70 PRINT #10, “ON 0”
80 PRINT #10, “FL 1”
90 INPUT #10, A$
100 PRINT A$
110 GOTO 80
120 END

From the example, the com port setting of instrument should be completed by code

instead of manual setting on the instrument.

Does this mean I should also set both com port for pc and instrument in the initialize.VI.

Sorry for the so much questions. This is my first time to use labview controlling instrument.

Thanks!

 

 

0 Kudos
Message 5 of 21
(7,217 Views)
No, no, no. To repeat, the sole purpose of the initialize function is to set the com port of the pc so that it matches the instrument settings so you can communicate. Since you say you are able to communicate with it, then it is working. The example code you posted does not write the com settings of the instrument either. It's configuring the pc's com port. If you are able to read and write, then everything is set up correctly. You don't need to do anything else. The only reason I mentioned the manual is if you wanted to change the instrument to a higher baud rate. This may not even be possible with the instrument so just forget I even mentioned it.
0 Kudos
Message 6 of 21
(7,214 Views)
Thanks Dennis, I learned a lot from you.
From the driver, I can read the data from instrument. But I still can't write data into instrument.
That's where my problem is.I just want to figure out how I can write data into instrument since
I already can read data through example 647 ID.VI.
In the initialize.VI, I can setup the initial baud rate, stop bit, parity, and databits. Once I click
run, for example I set baud rate as 4800 in pc, there is no error, but the baud rate in instrument
is still as instrument default 9600. I am just wondering whether I lack the VISA write action in
the initialize.VI so I can't get any response in the instrument ?
 
0 Kudos
Message 7 of 21
(7,213 Views)

There is obviously a huge communication problem here. Maybe shouting will help.

YOU SHOULD NOT BE USING THE INITIALIZE FUNCTION TO WRITE ANYTHING TO THE INSTRUMENT. YOU CANNOT USE THE INTIALIZE FUNCTION TO WRITE THE BAUD RATE TO THE INSTRUMENT. STOP USING THE INITIALIZE FUNCTION TO WRITE THE BAUD RATE TO THE INSTRUMENT.

0 Kudos
Message 8 of 21
(7,204 Views)
Hello Dennis,
I think you are right. My main problem right now is how to communicate with instrument first.
As you said, from my understand, the initialize.VI is just to setup the default of my pc, so it shows
no error, because everything is done well on my pc. At this moment, pc doesn't communicate
with instrument. So I try to add VISA write followed the initialize.VI for writting data into instrument.
Below is my function :
 
However, it shows error code -1073807339 which is timeout expired before operation completed.
I tried to increase timeout value from 5 sec. to 20 sec. in initilize.VI, but I think the value in initialize.VI
shouldn't affect that, because it just setup the default setting of pc. What should I modify of the function
so I can write data into instrument smoothly ?
Thanks!
0 Kudos
Message 9 of 21
(7,176 Views)

Can you attach that file directly to a post. Just use the Browse button below the message body (next to the attachment box).

What about the functions in the VI that actually do a write (i.e. the Select Limit Gas Channel)? Do any of those work?

0 Kudos
Message 10 of 21
(7,171 Views)