Instrument Control (GPIB, Serial, VISA, IVI)

취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

How can I automatically send a series of commands and values to a TC-36-25 temperature controller?

해결 완료!
솔루션으로 이동

Hi I’m trying to use some VIs I downloaded from the national instruments website to control a TC-36-25 temperature controller. Here’s the link to the VIs:

 

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=6A33C4F0E27013AFE04400144F1EF8...

 

I’m trying to use “RS-232 Communication.vi”. I can use this VI to send one command at a time to the TC-36-25 through the “TEC CMD” vi terminal. But I’d like to send a series of commands to the controller automatically to initialize and automate the instrument. I think this can be done by sending a series of commands to the “TEC CMD” vi terminal and a series of values to the “Input Value” terminal but I’m not sure how to do this.  I was thinking I could load the commands and values into an array and use a loop to send them into “RS-232 Communication.vi” But I’m not sure how to write such a loop; and even if I did, the “TEC CMD” terminal only seems to accept a specific set of commands of a special user defined type which I don’t know how to use/modify.

 

I appreciate any help you can give me.

 

Thanks,

0 포인트
1/6 메시지
4,467 조회수

You are pretty much correct. You'd need to use a loop. The designer(s) of that driver chose to use an enumeration for the command to send. Lucky for you it was made into a typedef. This means commands can be added, and then the "RS-232 Communication" VI would need to be modified to support the new command. There is a hidden front panel control on that VI that contains the hex values for the commands.

 

It sounds like your problem is really rooted in not knowing how to use LabVIEW. Have you done any of the tutorials? Read any of the Help?

 

To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

0 포인트
2/6 메시지
4,461 조회수

Yeah, I am a labview newbie. Thanks for your help, I'll dig into the control and type def stuff a little deeper.

0 포인트
3/6 메시지
4,456 조회수

I figured out how to create arrays of these commands and corresponding input values and send them to the controller. But I'd like to

load these commands and values automatically when I run the program. At this point I have to put them in manually every time I start the

program.

 

Do you know how I can save these commands/values to memory or load them from a text file? Or is there another better way to load these commands/values?

 

I've attached a copy of the VI I'm modifying. You can see the loop I made under the "init" case.

 

Thanks for your help.

0 포인트
4/6 메시지
4,437 조회수
솔루션
승인자 edCubed

If you want to leave those arrays on the front panel you can right-click on the array and select Data Operations -> Make Current Value Default. This will save the array's values with the VI. For the loop you should use auto-indexing rather than hard-wiring a value and then indexing out the array. Also, for the push buttons with latch action you will want to put the control terminals inside the event case so that LabVIEW will reset the control automatically. See attached mod that does has these small changes as well as some minor cleanup.

 

You started out with a state machine construct, which is an excellent place to start, and given that you're new with LabVIEW I think you've done a pretty good job so far. It's clear the code is still being flushed out (such as how to handle errors), but it seems to be a really good start.

5/6 메시지
4,429 조회수

Thanks, that was really helpful.기쁨 이모티콘

0 포인트
6/6 메시지
4,426 조회수