LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sorensen SGI control using labview

Hi,

 

I am attempting to control a sorensen sgi400/63 dc power supply using labview. I have the supply connected via rs232 and using windows hyper terminal i am able to issue a *idn? command and get a response back detailing model name / number etc. - This says to me that the comms link is working.

My troble comes when trying to use labview to do the control. I  have downloaded the labview driver for this power supply form ni.com - this gave me a .zip folder (called sornsg.zip) containing some .vis. I opened the self test vi. It seems when run in highlight execution mode that all is well writing to the supply, but reading from it throws the error -10738007339. Any ideas?

I have contacted sorensen but no reply as yet...

Many thanks.

Attached is screen shot of the vi not working quite as i'd like.

 

 

0 Kudos
Message 1 of 14
(4,334 Views)

I do not see where you have set up the com port setting other than the time out setting.

Is the baud rate set some where else?

The error code is a time out error after the 20 sec so I think your comport is not configured.

Drag down the property node where the time out is set and select serial port setting as seen below.

 

comport.png

 

Also try first the *IDN command to get that working first.

 

Omar
0 Kudos
Message 2 of 14
(4,322 Views)

Hi Omar,

Thank you for your reply.

I used hyper terminal and got that working ok. then moved onto max, and got comms working there - it was here that i found the termination characters that can be input to signal the end of a read, and can be added to each write. It was a lot of trial and error to get the read and write working. The write was throwing the time out error.

From here i modified the vi so that the termination charter was added that was working in max this character was - \r. Which i think was being added automaticallly by hyper terminal although i couldn't see it until i did a com port test test using a second compter with MAX to read what was going on on the com port.

It is all running nicely now.- just going to do some front panel tweaking!

thanks again - this was the first time i have posted on here - the help in the forums really is 1st class. Keep up the good work.

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

I prefer to setup my com ports inside my VI and do not rely on the default setting from the Windows Device Manger or from MAX.

They can be changed without you knowing it.

 

Just about 100% of my testing involves talking over RS232 and I do not have a single method that works for all chases, but must tailor each to the device that I am talking to. So if you have any question, ask.

 

 

Omar
0 Kudos
Message 4 of 14
(4,313 Views)

Hi, Yes my com port is set up in my vi, - i found it easier to get the comms working first with hyper terminal, then with MAX and then, once i knew i was readin and writing without fault i was able to set up in the vi.

First time at labview really, and pretty much first time with rs232. Think i am there now.

Thanks again for your help.

0 Kudos
Message 5 of 14
(4,307 Views)

Hi,

 

I'm also trying to get my Sorensen SGI power supply to work with Labview through serial communcation with the drivers provided by NI. As discussed above, Hyperterninal seems to work OK with standard commands. MAX will work if a "- \r" or just a "\r" as a termination character. However, Labview still will not work for me. Here is the self test program that I modified for serial and self test command. I have tried different termination characters (- \r,-\r,\r, none) but nothing seems to work. Any help would be appreciated.

Self Test

0 Kudos
Message 6 of 14
(4,095 Views)
  1. *IDN? follow by the return is all you need. Press the enter key for the return. Do not type in \r or -\r unless you have the display mode set the "\" code Display
  2. I have never used flow control with a Sorensen. Set the flow control to none.
  3. Set the the termination on read to a 10.

 

 

Omar
0 Kudos
Message 7 of 14
(4,088 Views)

Hi Omar II,

 

Yes, I tried this with a return also. I still have the error. I'm not sure what you mean by changing the display mode to "\".

 

The manual states Xon\Xoff for flow control. This works fine in hyperterminal and Max. However I also tried none with the different

combinations of termination and still have the error.

 

Is there anyway to configure a termination character in labview? It seems like this is how hyperterminal handles it. Max requires a termination character

to get a reply but not in Labview. I'm not sure why this is.

 

I still have two weeks left of my support contract, so I guess I'll contact NI.

 

Thanks again for the help.

0 Kudos
Message 8 of 14
(4,082 Views)

I still have the error.

What error are you getting?

 

I'm not sure what you mean by changing the display mode to "\".

Right click on your "*IDN?" string constant and select the display mode - Normal, \, Hex or Password

Also in the "Visible Items" select "Display Style" to show the '\" symbol in the string constant.

 untitled.PNG

 

Is there anyway to configure a termination character in labview?

Yes with the same property node that you are using to set the other com port settings.

untitled.PNG

 

But for the writes you do not need to if you include at the end of your *IDN? string. Now as for the read, it is good to set the termination character for the VISA reads and then set the bytes to read to some number larger than anything you expect.

 

 

Omar
Message 9 of 14
(4,072 Views)

Have you set the XON and XOFF characters? They default to 0 (null)

They are also set with the property node.

Omar
0 Kudos
Message 10 of 14
(4,069 Views)