From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a string structure into a VI?

I am trying to control an Arcus DMX-J stepper motor using LabViIEW.

Arcus has provided a LabVIEW library that will control the motor. However the library requires the user to input ASCII commands.

 

Basically my setup is this: I have input from two thermocouples via a NI board fed into a simple LabVIEW VI program. Based on the temperature differential between these thermocouples I would like the motor to speed up or slow down. I would like the LabVIEW vi to interpret the data and output the relevant string structure to the library supplied by Arcus to control the motor.

 

Is this feasible? Does this make sense? Any bright ideas?

Thanks so much!

0 Kudos
Message 1 of 64
(4,340 Views)

This sounds pretty straightforward. Do you have a datasheet or protocol defining what messages the stepper motor controller expects?

0 Kudos
Message 2 of 64
(4,325 Views)

Here is an example.  It isn't complete.  there is no stop condition.  Thermocouple data is simulated by random number generators.

 

19699iCFC99DF6EADAD50A

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 64
(4,322 Views)

Thank you for the responses.

 

Yes there is a list of ASCII commands. It is slightly more complicated (I will need to pass a command to initiate the motor before anything else happens, eg) but here is a short list of the more relevant commands

 

 

Command      Value Range     Unit   Description                                    Return
EO=[value]   0 – off                Enables the motor power                        OK
             1 – on
HSPD                         pps    Returns high speed value                       100 to 200000
HSPD=[value] 100 to 200,000  pps    Sets high speed value                          OK
J+                                  Jog the motor in positive direction            OK
J-                                  Jog the motor in minus direction               OK
STOP                                Performs ramp down stop if motor is in motion  OK

 

What is the function you used that actually passes the string structure? (it looks like a little movie reel on the VI image you inserted)

 

0 Kudos
Message 4 of 64
(4,288 Views)

That "film reel" is a sequence structure, and it's acting only as a placeholder.  If I understand correctly, your question is not how to pass the string into a VI, but how to pass the string to the Arcus library.  If that's the case, you need to provide more documentation about the library.  Is it a actually a LabVIEW library, or is it a standard DLL, an ActiveX component, a .NET assembly, or something else?  That will determine how you send the string to the motor.  Did Arcus provide you with example LabVIEW code?

0 Kudos
Message 5 of 64
(4,283 Views)

What I have shown was how to select which text to send depending upon some numeric value.  How to send data to your device depends upon the library of code you were given.

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 64
(4,271 Views)

Yes you are correct. (I assumed passing a string from one VI to another would be the same as passing from a VI to a library).

 

Arcus has provided an actual LabVIEW library. They have provided no LabVIEW code, other than the group of VI's contained within the library.

 

If I could I would attach this information.

In fact:

The Manual

The Library

0 Kudos
Message 7 of 64
(4,266 Views)

Never link to some strange third-party hosting site. If you want to provide code, use the Attachments option. It's right below the message body. In my opinion, it's pretty hard to miss.

0 Kudos
Message 8 of 64
(4,251 Views)

You're right. I'm sorry. I didn't see it until after I had inserted the links.

Here you go again:

 

Download All
0 Kudos
Message 9 of 64
(4,239 Views)

What exactly is your issue? The library you were given has the VIs to send the commands. There is no need to have to create the ASCII commands. The "command_generator" VI will create the command string. All you need to do is to select which command to send using the enum. For example, to set the position you'd do this:

 

 

 

Your question about the film strip requires me to say this:

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the 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 Kudos
Message 10 of 64
(4,231 Views)