LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling Tera Term from labview

Solved!
Go to solution

Hi guys:)

 

In my new project I would like to send commands to Tera Term Pro. Tera Term then responds to the commands from Labview the same way as I would type the commands directly into Tera Term.

I'm able to use cmd.exe with the SystemExecute Vi, but for my program I would like to do the same with Tera Term.

 

I would like to send commands with a stringcontrol and get the respond in a string indicator, all in labview. Tera Term should run invisible in the background.

 

So for this I thought using ActiveX would be the best. I have downloaded tera term pro.

In Labview I create this from the ActiveX Palette and select browse on the ActiveX Class.

a.png:

 

In the Tera Term folder I find many .dll's:

b.png

 

I have tried to open them all, but I only get this message:

c.png:

 

Does this mean it's impossible to use Tera Term with Labview like I described?

I'm not so familiar with ActiveX, only with Excel (which is in the ActiveX Class list), so I might have missed something.

 

My goal was to create a sub-vi which does the communication with Tera Term, the same way SystemExecute VI is built.

 

Regards,

Even

 

 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 1 of 17
(13,350 Views)

The sysexec node will invoke the command window to run other exe's.

 

You could run a .bat file to call the code and pass parameters. Redircting output to a file to get teh returned data.

 

Watch for scaes in the path (use double quotes to encompass the command line).

 

Have fun,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 17
(13,341 Views)

Are you sure that Tera Term Pro actually has an ActiveX Server? I don't believe it does, but I may be mistaken. One thing that's for sure: just because you have a bunch of DLLs doesn't mean there's an ActiveX interface.

 

An alternative is to use a third party automation program that can be called from LabVIEW. Several of these have been mentioned on the forums in the past. One that I've used successfully (and I've posted examples) is AutoIt, but as I noted there are plenty of other ones. Note that with this method Tera Term need to be running.

 

As an aside, what are you doing with Tera Term that you cannot do in LabVIEW? What are you using Tera Term to do?

Message 3 of 17
(13,329 Views)

Hi guys 🙂

 

Thank for the answers! My company use Tera Term for communication with different testplatforms, using RS232. On the platforms we can put circuitboards and run diffrent tests. The circuitboards got a testsoftware in its microprocessor and we can start different testroutines by typing commands in Tera Term.

 

I usually write Labview programs for measurementreadings of voltage, current etc. but now my boss wants me to use RS232 also. Since Tera Term is a terminal and is used alot, I  thought I could use it with ActiveX, but I think it's like you said, smercurio_fc, that there is no ActiveX server.

 

Since I'm just a CLN (Certified Labview Noob), I haven't done any communication with RS232 from Labview yet. In November I'll take some courses at National Instruments here in Norway, but at the moment I'm quite clueless with this subject.

 

Yesterday I got so hung up with Tera Term, I didn't think about just using RS232 communication in Labview. If I can send some simple stringvalues like "Start", "stop" etc to the RS232, it's alot easier than make the communication with Tera Term. I'll search around the forum and see what I can find.

 

 

And for you Ben. I think you suggestion will work, but I haven't had time to check it out yet. Now I got some possibilities and I'll start the research right away 🙂

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 4 of 17
(13,302 Views)
Solution
Accepted by topic author EvenDeejay

Before you search around the forum, open LabVIEW and go to Help>Find Examples. Do a search for 'serial'. There are a couple of examples. Try those first. They aren't the most sophisticated but should get you started.

Message 5 of 17
(13,298 Views)

ok, first of all: *smashing head into keyboard, then into monitor* I searched for "RS232" rather than "serial" in the example finder. No wonder I didn't find anything.

 

Thanks alot Dennis 🙂 I got all I needed from the advanced serial read/write. I'll accept that as a solution even though you all have the correct answer for my question:)

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 6 of 17
(13,288 Views)

Sorry for this late reply. I have been using Teraterm Macro (not Teraterm Pro serial terminal) to interface with my previous provisioning app written in LabVIEW.

 

Teraterm Macro is such a lifesaver in that it can easily interface with your development boards that need: (1) RS-232C, (2) FTP, (3) TFTP or (4) SSH connections. The plain-vanilla 'serial' VI's are just that - serial port only and those need additional code to work reliably. If you need a good serial port VI try Prabhakant Patil's Hyper Terminal for LV 2009 and newer. You will find an ZIP or VIPM package from LAVA (lava.org). I have used his versions countless of times and is 10x more reliable than provided in LV examples.

 

teraterm-macro-exe.jpg

 

You will indeed use the System-Exec.VI to call Teraterm Macro since *sigh* no one has written a wrapper for the DLLs (as you mentioned they are built for .Net framework. I have talked with the current developers and they are willing to give anyone the pass to extend Teraterm for LabVIEW so C++ devs out there with good LabVIEW knowledge should re-build the DLLs as static libraries that can be called from within LabVIEW. For now, this is the only way and it is a kludge - but it works - just not in a way you expect.

 

calling-teraterm-macro-exe=from-vi.jpg

 

Here you can see that I am building the command line arguments before I call the system-exec node. Refer to the excellent how-to instructions at:

http://ttssh2.sourceforge.jp/manual/en/macro/commandline.html

 

Teraterm Macro will be spawned (opened) like it would when called from the command line. Its std input & output are not tied to your VI. You can merely pass arguments to the system-exec node. This is the reasons why we need someone to recompile the Teraterm Macro DLL as a static library (anyone?) so we can build a wrapper VI around the functions. Then its std inputs and outputs can be tied to LabVIEW's controls and indicators - hence, it becomes LV native.

 

-Relativity

 

Message 7 of 17
(11,477 Views)

It all seems so convoluted.  Why use a dll wrapper to execute a non-native code to send a chain of commands when you can just send the chain of commands straight to the serial port instead?  I'm guessing that's why no one has done anything like this yet.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 17
(11,473 Views)

Actually I needed to access the embedded Linux firmware via Telnet or SSH when the serial headers are no longer accessible. I am a system hardware tester and I do both black and white box testing.

 

How do you that with the serial terminal VIs? Teraterm Macro simplifies this and still makes the interface appear as though you are connected from the serial port. In this instance, Teraterm Macro is a god-send as I know of no other excellent and 'FREE' product that can match it.

 

So a Labview wrapper for Teraterm Macro would be great so that it would appear to be native to LV. You can use front panel controls and indicators since you would have those wired to the wrapper VIs.

 

-Aldrin

 

0 Kudos
Message 9 of 17
(11,463 Views)

@Relativity wrote:

Actually I needed to access the embedded Linux firmware via Telnet or SSH when the serial headers are no longer accessible. I am a system hardware tester and I do both black and white box testing.

 

How do you that with the serial terminal VIs? Teraterm Macro simplifies this and still makes the interface appear as though you are connected from the serial port. In this instance, Teraterm Macro is a god-send as I know of no other excellent and 'FREE' product that can match it.

 

So a Labview wrapper for Teraterm Macro would be great so that it would appear to be native to LV. You can use front panel controls and indicators since you would have those wired to the wrapper VIs.

 

-Aldrin

 


That's actually very interesting.  If Tera Term has a development kit, you might be able to do it yourself.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 17
(11,441 Views)