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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication and LANG MCL-2 stepping-motor control

I want to use Labview to control LANG MCL-2 stepping-motor controller for a microscope (product link: http://www.lang.de/index.php?id=44). A usb to serial adaptor us used to connect the controller to the computer. I did a loopback test using the Basic Serial Write and Read.vi example and the "read string" match "string to write". However, when the controller was connected, the bytes read was 0. 

 

To make sure the controller function properly, I tested it using the software provided by the vendor. There is no problem to control it. Unfortunately, the software is a bit old and not compatible with windows xp.

 

I am new to Labview and any advice will be really appreciated.

0 Kudos
Message 1 of 11
(4,961 Views)
The loopback test does nothing more than verify that the pc's com port is working. It does nothing to verify that your com settings are correct, the cable type is correct, or that the commands you are sending is correct. Since the vendor's software is working, you can pretty much eliminate a bad cable. You might want to use portmon and compare the commands you are sending and what the vendor's program is sending. Common mistakes are sending in the wrong format (i.e. ASCII and not hex) or not sending the correct termination character.
0 Kudos
Message 2 of 11
(4,957 Views)
Thanks for your suggestion. I did not explain my problem clearly in the previous post. The vendor's software is developed for windows 98 and 2000. When I installed it on computers using windows xp, it is not able to communicate with the controller. That is part of the reason I want to use labview to controll the controller. 
0 Kudos
Message 3 of 11
(4,908 Views)

I understood your problem. I was not clear that you could try running portmon on the pc that does work with the software.

 

As I said, doing a loopback test is not at all relevant. Do you have a manual that explains the commands you need to send? Can you attach it or provide a link to the programming manual? What is the exact command you are sending?

0 Kudos
Message 4 of 11
(4,901 Views)
Here is the link to the software and manual http://www.lang-us.com/index.php?id=77. The software should be Win_Commander for MCL controller.
0 Kudos
Message 5 of 11
(4,892 Views)
I fail to see anything there that is at all useful. You've pointed to the manual on the software that you cannot get to work. Do you actually have any documentation on using the instrument without the vendor's software? That is essential to getting something working in LabVIEW. If you don't have that, how can you be sending anything to the instrument with the example you mentioned?
0 Kudos
Message 6 of 11
(4,889 Views)
I have a manual for the MCL-2 controller.
0 Kudos
Message 7 of 11
(4,864 Views)

That attachment is unreadable.

 

Edit - never mind. Had tosave it to disk first. Strange that clicking on it did not bring it up.

Message Edited by Dennis Knutson on 06-16-2010 08:13 AM
0 Kudos
Message 8 of 11
(4,852 Views)
So, now it comes down to correctly setting the com port and sending the correct command string. As you see, you will need to send someor all as hex and get familiar with the ASCII table. The Chr$ converts (I believe) a decimal to its' ASCII character. You can set a LabVIEW string control to hex display or use the Byte Array to String function.
0 Kudos
Message 9 of 11
(4,845 Views)

Hi,

 

I am having very similar problems.  The simple program that came with stepping motor I am using works fine, which confirms there isn't a faulty cable etc... However, I am also trying to use LabVIEW to talk to the stepping motor (which then controls a monochrometer).  The program I need to write will be a simple one; the goal is to have a scope do a reading at a certain wavelength, once the reading is done, change the wavelength of the monochrometer via the stepping motor, take another reading and so on...  I am having trouble communicating with my stepping motor using LabVIEW.  Any string I input, an identical string is output.  Perhaps its the command string that I've messed up... I am using the Basic Serial Read and Write VI supplied by NI.  Here is a link to the user manual that includes the programming commands:http://www.ams2000.com/docs/TechManuals/dcb241ma.pdf .   Any help at all would be fantastic.

 

Thanks a Bunch,

 

Cam 

0 Kudos
Message 10 of 11
(4,180 Views)