LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Needed: Sending Commands to Mark-10 Device Using LabVIEW VISA

Hi everyone,

I’m working on a LabVIEW application to control a Mark-10 device (specifically to set and control the distance) via the VISA serial communication interface. So far, I’ve successfully established communication and can read the distance value by sending the "x" command. However, I’m having trouble implementing a feature to set the distance from my LabVIEW VI instead of using the physical Mark-10 control panel.

Here’s what I’ve done so far:

  1. I’ve configured the VISA communication settings (baud rate, data bits, parity, etc.) as per the Mark-10 manual.
  2. I’ve created a VI to send a command string for setting the distance using the required syntax from the manual.
  3. However, when I send the command, the device either moves in the wrong direction or makes a ticking noise without moving properly.

Attached is a screenshot of my block diagram. The VI logic attempts to send a formatted command to move to a specific distance.

My questions are:

  1. Has anyone successfully controlled the distance of a Mark-10 device via LabVIEW? If so, could you share a working example or provide guidance on how to structure the commands?
  2. Are there specific steps I need to take to ensure the Mark-10 device properly interprets and executes the command? (e.g., formatting, delays, or termination characters?)
  3. Is there an existing VI for Mark-10 devices or general tips for controlling similar equipment via VISA?

Any help, example VIs, or troubleshooting tips would be greatly appreciated. Thank you!

0 Kudos
Message 1 of 7
(969 Views)

A quick google shows me that there is LabVIEW Serial Write / Read VI under Software and Driver Downloads | Mark-10 Force and Torque Measurement

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 7
(934 Views)

Actually, no, it doesn't provide an option for controlling movement (e.g., going up or down). The LabVIEW VISA functionality works only for reading data from the Mark-10 device in this context. If you need to send movement commands, you might need to review the Mark-10 manual for the correct syntax or ensure your commands match the expected format for proper execution.

0 Kudos
Message 3 of 7
(925 Views)

@tonyju wrote:

Actually, no, it doesn't provide an option for controlling movement (e.g., going up or down). The LabVIEW VISA functionality works only for reading data from the Mark-10 device in this context. If you need to send movement commands, you might need to review the Mark-10 manual for the correct syntax or ensure your commands match the expected format for proper execution.


That is not true. The VI is a simple serial communication program, and not a good one at that (use of Bytes at Serial Port is acceptable for a pure console type application but never for instrument control with commands).

 

What the VI does is determined by the command string in the "String to Write" control, which by default is set to ?\r. This queries the current position, that's it. Nobody prevents you from entering a different command in that command string as mentioned in the accompanying document, which says "Refer to applicable Mark-10 user’s guides for a listing of serial port commands."

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 7
(887 Views)

tonyju,

 

I have been able to set ad control the distance on Mark-10 TSTC-DC and ESM-303 test stands.  I'm a little reluctant to include a picture of my block diagram, as I know my coding is not elegant and probably flat out wrong in places.  At any rate, I start by initializing the COM port as you say you have successfully done.  I programmatically do the following using the VISA Write function and the appropriate commands given in the Mark-10 manuals: re-zero the distance or rotation, set units as desired (in, mm ,rev, degrees), set speed, set stand to programmed speed, enter travel limit mode, set (CW, CCW, lower, or upper) travel limit, then start the test stand moving in the required direction.  I then start a while loop that reads the (force, torque) and (distance, revolutions).  In the while loop is the In Range and Coerce function.  I feed the set travel limit into this function (first converting the string into a number).  I have a numeric control for the travel resolution that I add or subtract from the travel setpoint and that sum and difference become the limits for the In Range and Coerce function.  For example, if I have a distance setpoint of 1.0 inches and a resolution of 0.05 inches, the limits in the In Range and Coerce function are 1.05 and 0.95 inches.  Finally, the current travel is fed into the middle input (x) of the function.  The while loop stops when the function sees that the current travel is within the limits.  You will probably need to adjust the resolution and loop timeout depending on your speed setting.

 

Couldn't stop myself, a screenshot is attached.  Hoping for none of the occasional snarky critique from the community - I know my code is not great.  I'm a functional programmer 🙂

 
 

 

0 Kudos
Message 5 of 7
(121 Views)

A heavily cropped block diagram picture imbedded inside a pdf document is not really useful, especially since there is no obvious VISA code visible in any form. I assume all the heavy lifting is done in that subVI with an instrument on the icon, but we cannot tell what's inside of it. Is this from a driver kit or home made?

0 Kudos
Message 6 of 7
(84 Views)

 Apologies for any poorly communicated information.  I haven't posted on the forum before but I ran across this issue while searching for another issue I am having.  It took me a while to figure this out when I was trying to do the same thing so I hope this ends up helping.  Knight, yes the heavy lifting is done by the homemade sub-VI for CW rotation on a TSTM-DC machine shown below (also shown with a red arrow further below).  This is the series of commands I use to get my Mark-10 stands moving.

Sub-VI.png

The travel limit setpoint from the sub-VI gets wired into the while loop I mentioned in my last post.  I am showing the while loop for downward motion on an ESM-303 machine because it is a little cleaner than programs I have for rotation, but up/down/CW/CCW all work the same.

VI.png

FYI, I have issues with my TSTM-DC stands suddenly slowing down partway through their travel and continuing to be slow until they come to the travel limit, whether I am controlling them with LabVIEW or the Mark-10 controllers.  I have sent one of my stands in to Mark-10 and they could not diagnose the problem.  They believe it is the position sensor temporarily losing its way.  Regardless, when this happens during a cycle test, I have not been able to get LabVIEW to continue the cycle test when this happens.  It just sits there until I manually push the proper button on the machine controller to continue the test.  No issues like this with my ESM-303 stands though.

0 Kudos
Message 7 of 7
(59 Views)