LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Velmex Bislide Labview

Hi Laia,

 

Let me start by asking: are you able to communicate at all with the controller, for example by running the "minimum code to run" example you mentioned previously? If you are, you should not need to bother with VISA. Even if you are unable to communicate, I have never found it necessary to use VISA. 

 

Typically, you connect your controller(s) either to an RS-232 (serial) interface, or you can use a virtual COM port by using a serial to USB dongle, which is what I've generally done. In any case, the port you are connecting to will be COMXX, where "XX" is the number of the physical or virtual COM port. If I remember correctly, even if you have multiple controllers, you can connect them with a cable and address the axes by an integer value in your commands. 

 

The tricky part about programming the slides is issuing the text commands in user-readable format and then translating them into something the controller understands. The additional work on top of that is done by creating a functional user interface with these base level "move" commands.

 

Let me know if you are able to communicate with the contoller first and we can take it from there. I believe the 'Minimum Code to Run" vi has an auto-detect port, but I could be remembering incorrectly. I will have a look in a moment.

 

C

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 11 of 22
(1,864 Views)

I can comunicate with the minimum code torun.vi but the problem is that it is using COSMOS and I don't want to use this comments. 

 

Thank you, 

 

Laia

0 Kudos
Message 12 of 22
(1,861 Views)

Hi Laia,

 

COSMOS is a separate piece of software from LabVIEW entirely and built on another software platform. What you may be seeing, now that I look at this code, is a debug option that opens a terminal as the commands are issued. You may disable this by changing the boolean constant to False in the first frame on the block diagram (see first frame of attached code picture).

 

Typically, in an application where you connect to an external device, you will check connection status as or after you attempt to establsh the connection. In this way, you can both alert the user to the fact that you are not successfully connecting, and also either halt the program or at least abort execution of other code downstream, such as sending further commands to the device.

 

As an example, see what I've attached. After the port is opened, the status is checked to see whether or not it is open. This could then return a dialog to the user, or just post the result in an error indicator. Typically, these errors would be returned by the original function call, i.e. when you ask it to open the port, it should provide you with an error that tells you it was unable to open the port. In any case, if see that you are unable to open the port, and do not run any of the code downstream and make the user aware that this is the case.

 

One thing that also makes it a bit difficult to decipher exactly what you are doing without opening up the block diagram of the VXM multifunction VI is that typically all controls (inputs) are placed on the left of the block, and indicators (outputs) on the right.

 

Colin

 

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 13 of 22
(1,856 Views)

Laia,

I reposted Charlies code in the Velmex Forum with it saved for Version 8 (I think, if Labview converted all the Vi's to version 😎

 

Colin is correct with "COSMOS is a separate piece of software from LabVIEW entirely and built on another software platform. What you are seeing is the debug terminal to show the actual characters being sent and read by the Serial Port.

 

Yes it is the same terminal as I used in COSMOS, but in the VXM Driver it is used for debugging purposes (such as if your code looks locked up you do not have to add new debugging windows to find the problem, you could just leave the debug terminal open and send a verify ("V") command directly to the control to see if the problem is a hardware problem? or a problem in your code?)

 

Most people do not need it, so they do not call that function (which is why it is marked as optional)

 

Between the changes Charlie suggested (and I am looking at) and my saving it for version 8 might simplify your confusion

0 Kudos
Message 14 of 22
(1,847 Views)

Laia,

 

A quick sanity check would be to run this with your controller on: 

 

http://zone.ni.com/devzone/cda/epd/p/id/2757

 

I have a version of this I was going to send you, but you may be running an earlier version of LabVIEW than I. Your controller should pop up in the array here if you have it connected and communicating.

 

Colin

 

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 15 of 22
(1,842 Views)

Hi!

This is working perfect!

Now I have to fix the other part.

 

Thank's,

 

Laia

0 Kudos
Message 16 of 22
(1,824 Views)

Charlie posted this at Velmex Forums and got me wondering what works and what does not work?

 

Laia,
I saw your post about "Do you think that it is possible to use LabJack instead of VISA?"???

I have never heard of Labjack, but taking a quick look it would appear to add more complexity to a user that does not understand the basics of serial communication.

From the Labview forums I found a post (names removed to protect the innocent)
"A quick sanity check would be to run this with your controller on: Find All COM VISA Resource Names at http://zone.ni.com/devzone/cda/epd/p/id/2757"

I gave this a shot and thought it would work, but it did nothing? (I wonder what I missed?)

Laia, can you post what you have working? and did you check out the code that Velmexcontrols posted? That may simplify things?

 

If you can post at the Velmex forums I can take a look at what is working and what I may want to add to the driver to ease the usage in all languages

0 Kudos
Message 17 of 22
(1,802 Views)

LabJacks are great value devices that operate on USB or etherner across a LAN.

 

I"ve written tons of code for these over the years and have used them as the primary class of DAQs in laboratory settings where cost is a concern. They are not, however, terribly intuitive to program.

 

For this reason, I've written a library that is available on the LV Tools Network that includes a number of applications that make it easy to use one or multiple LabJacks on a network. You can see them here: http://interfaceinnovations.org/labjackproducts.html . I've also a user group setup for this toolkit that I put up a day or two ago: https://decibel.ni.com/content/groups/labjack-utilities . You may download the project through the VIPM program (through the NI Tools Network). I'm not sure what LabVIEW version you are using, but it is currently only released for 2012. If I have a request I may save it backward. I also have plans to develop a free version of the software, but in any case you can use it for 30 days.

 

I've used velmex slides and LabJack devices before, for example to actuate devices, acquire inputs, and such, while stepping the motor between acquisitions. Fun projects!

 

C

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 18 of 22
(1,798 Views)

Finally we decide to try another thing. However it is not working...

 

Can anyone help us? 

 

Thank you,

 

Laia

Download All
0 Kudos
Message 19 of 22
(1,779 Views)

More files...

0 Kudos
Message 20 of 22
(1,778 Views)