LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anybosy have an example to work on with OMEGA CN612 temperature controller

Solved!
Go to solution
Solution
Accepted by topic author AnkitG

Attached is a simple VI I wrote for the Omega CN612 temperature display.  I set it up as an action engine so that early in the program, this VI is used to initialize the serial port, in my loop I use it to get the 12 temperatures.  And at the end of the program I close the serial port.

Message 11 of 33
(2,091 Views)

Awsome Ravens fan.  Compared to the 616 driver there are some differences, termination character, number of bits in a read, etc..   

 

The write might never be registered if it has an incorrect termination character (?), causing the read to time out. 

-------
Mark Ramsdale
-------
0 Kudos
Message 12 of 33
(2,082 Views)

Data bits??  They seem to be the same between the CN612 and the CN616.  Both seem to use 4800,8,none,1

 

I'm not sure why my termination character is hex 6C, or character lower case "L".  It doesn't seem like I should have a termination character according to the manual.  But whenever I first started working with this VI to communicate with the CN612 a couple years ago, this is what I got working.  I'll have to experiment with that again.  It might be the checksum byte, but from what I can recall, I don't think the device really used that byte as a checksum.  I think it might have always been lower case "L" no matter what data was sent.

 

There are a different number of bytes in the read, and that is due to the amount of data being sent back.

 

The two manuals of interest

 

CN612 http://www.omega.com/Manuals/manualpdf/M2818.pdf.  49 bytes for all the data (4 bytes x 12 channels plus checksum byte)

CN616 http://www.omega.com/Manuals/manualpdf/M3321.pdf  28 bytes for temperature data (4 bytes x 6 channels plus 4 "alarm" bytes)

 

Another important thing is that the first byte is "L" on the command string.  The second byte is a digit from "0" to "9" which is the address of the controller.  For my application, it was set to address 1.  The manual for the CN616 uses 3 in its examples.  The manual for the CN612 doesn't show examples with the address byte.  Perhaps the OP is using the wrong address byte.

0 Kudos
Message 13 of 33
(2,074 Views)

Hi,

 

I used the Command L0M, L0T in hyperterminal to communiate and display the temperature , it did work but using the same commands in the MaX and Vi doesn't work. All the ports settings are same in hyperterminal and MAX.

 

@ Ravens Fan: I used your Vi, but i am getting error : 

Error -1073807346 occurred at VISA Write in OmegaCN612.vi

Possible reason(s):

VISA:  (Hex 0xBFFF000E) The given session or object reference is invalid.

 

 

I tried to give different id no. for scanner but every time i get this error.

 

Please let me know what i am doing wrong here.

 

Thanks,

 

Ankit

0 Kudos
Message 14 of 33
(2,059 Views)

That error number means there is something wrong with the VISA resource you are using.  Did you identify the correct com port when you first ran the initialize action of the subVI?  Put a probe on the purple VISA wire right after the case structure so you can see what VISA reference it is using.

0 Kudos
Message 15 of 33
(2,055 Views)

Hi,

 

I corrected the port but again its same problem of time out expired in read.

 

Error -1073807339 occurred at VISA Read in OmegaCN612.vi

Possible reason(s):

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

 

I tried to use L0T...L9T commands in the write visa .

0 Kudos
Message 16 of 33
(2,052 Views)

Did you change the other parts of my code so that it matches the command and response structure of the CN616?  As I said in my earlier post, the number of bytes are different.  With the 612, I request 49 bytes.  When it returns 49 bytes (I discard any message that isn't 49 bytes because something would be misaligned and thus bad data.) I have a for loop to go through and pick out the 4 characters that make up each of the 12 temperature values.  Since you only have 6 temperature values, the For Loop needs to change as well.

0 Kudos
Message 17 of 33
(2,049 Views)

Hi Raven,

 

I too have Omega Cn612 with 12 temperature zones. Do I need to change anything else in the code.?

 

0 Kudos
Message 18 of 33
(2,046 Views)

I'm sorry about that.  When I saw the CN616 mentioned in an earlier post, I was under the impression that you were trying to communicate with that model.  I just got confused as to which device you were actually using.

 

I don't think you should need to change anything else.  I'd recommend putting a probe on the string wire coming out of the VISA read to see if that is showing any interesting data.  If it works in hyperterminal, it should be able to work in LabVIEW.  I know this one works just fine for me.  (Assuming you've closed the port in hyperterminal before trying to run the LabVIEW code.)  Just try to use probes and highlight execution to debug what is going on.

 

How quickly does the device respond to the command when you use it in hyperterminal?  You may want to try increasing the timeout for the VISA in the Init case.  I set mine for 2 seconds (default VISA is 10 seconds).  If for some reason it is taking just a bit longer than 2 seconds to respond, you'll get a timeout error.  But I don't see any reason for it to take that long unless you are reading the device through some unstable virtual com port networked serial server.  (Actually I originally used a small private network to communicate with this and some other device through a network serial server.  It generally worked.  But I also ran into occasional problems where a noisy motor controller interfered with the communication.)

 

I'm attaching an image of a very basic VI to show how it uses this subVI.

 

 

0 Kudos
Message 19 of 33
(2,043 Views)

Hi Raven,

 

Thanks a lot , it finally did work out for me.

 

- Ankit G

0 Kudos
Message 20 of 33
(2,033 Views)