Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent READ output at NI-MAX and Labview for Serial Port Device (mk2000)

Solved!
Go to solution

I am trying to communicate with my new instec mk2000 temperature controller connected to COM port. In NI-MAX i/o test, I am getting inconsistent output for read. Sometimes it gives correct output for *IDN?\n and sometimes i get errors like ''invalid character",''undefined header",''time-out''. Sometimes I also get output for a previosly sent command when new command is sent.

port settings are set to 

 

Baud rate: 9600

Data bits: 8

Parity: Even

Stop bits:1

Flow control:none

 

Simple Call device program in Labview is showing time-out error everytime.

 

Please help. I am clueless....!!!

 

Thanks in advance

0 Kudos
Message 1 of 14
(3,074 Views)

I suspect a very slow interface on the mk2000 interface. Not for sure but try to write the characters to th mk2000 one by one.

Build a special write slow.vi in which a for loop sends each character one by one instead of a complete string. I've seen this a few times loooong ago.

And post the testvi to get comments.

greetings from the Netherlands
Message 2 of 14
(3,053 Views)

Thanks for the response. I will do as you said and post later.

0 Kudos
Message 3 of 14
(3,047 Views)

Hello Albert, I tried to do what you said. I converted string into array of characters and fed it to For loop. For every character, it shows the same error that it shows when whole string command is fed at once. Here are shot of the Program and output. Is this what you said ( I am a beginner ). What should I do ??Block DiagramBlock DiagramFront panelFront panel

0 Kudos
Message 4 of 14
(3,033 Views)

Hi

You should only have the write in the for loop. Not the initialize and the read. Only read after the for loop.
You must send complete cmd before expecting a real answer.
greetings from the Netherlands
Message 5 of 14
(3,023 Views)

NEW mod sugg.JPGHello Albert.

 

I change it like you have suggested. I have also added a new line command to every command as suggested by someone. 

Good news is it works.

But, a wrong command or an error creates a lag between command and output thereafter. In this picture you can see that I am getting the output for current temperature command when i called for *idn? . Current temp command was called before *idn? but got an error. Why is this so ?? 

 

With best regards and warm wishes for coming holidays...

Abinash

0 Kudos
Message 6 of 14
(3,006 Views)

Hi

Probably because that one was not read yet.

Can you send your vi, I can see some improvements that will make it easier for you, but don't want to construct the whole vi.

greetings from the Netherlands
Message 7 of 14
(3,001 Views)

Hi Albert. Here is the vi

0 Kudos
Message 8 of 14
(2,997 Views)
Solution
Accepted by topic author kharkhua

Hi

I modified the real part into a query vi. In which the single write chars is in the subvi and has the possibility to have another end char and/or another number of data to read.

I left out the 50 ms wait, probably not needed, but you can easily add it yourself.

Now there is only one for loop and modularity is improved.

 

good luck and publish this for other mk 2000 users.

greetings from the Netherlands
0 Kudos
Message 9 of 14
(2,993 Views)

thank you  Albert. Unfortunately they are not openning in LabView 18. I will upgrade and run them, also publish for others.

0 Kudos
Message 10 of 14
(2,982 Views)