LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control robot by sending G-Code to Smoothieboard

I have an opentrons OT-One Pro liquid handling robot (see this link) that uses a smoothie board (see this link).  The robot comes with an opentrons GUI but because I've made some modifications to the robot that no longer works.  I'd like to use labview to send G-Code to the smoothie board and control the robot, but I don't know where to begin.  I know the board shows up on my PC as a serial device according to device manager, but it doesn't show up under Devices and Interfaces on MAX. 

 

Any suggestions would be much appreciated,

Thanks

0 Kudos
Message 1 of 9
(3,648 Views)

My first question would be: Does the smoothieboard support running actual G-Code on it?

I guess it doesn't, so you'll have a hard time running LabVIEW code on it.

If you want to communicate to it over serial, you can still create a LabVIEW Program that sends commands to the board over VISA.

 

What software is running on the board though? Is there some standard software that provides you with a standard set of commands for the serial control?

 

As for the board not showing up in MAX, it's usually one of the two reasons described here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6soSAC&l=en-CA



Remember Cunningham's Law
0 Kudos
Message 2 of 9
(3,627 Views)

No.  It won't show up as a device under MAX.  Serial ports are rather "dumb" in that they don't know what is connected to them.

 

To start, you need to read the communications manual and see what they say about serial port settings (baud, data bits, stop bits, parity) and about the protocol (how is the message structured, is it command send with a response received.)

 

If the original was still working, you could use a port sniffer to see what the data looks like while that one was running.

 

There are examples for VISA serial in the Example Finder.  But I'll warn you now, the most common example people start with is Simple Serial.vi  or I think it used to be called Basic Serial Read/Write.  DO NOT USE IT!  It uses Bytes at Port which is the wrong thing to use 99% of the time.  If you start with that, I'm certain you'll have problems and you'll be back on the forums with questions about why it isn't working and you are getting incomplete data.

0 Kudos
Message 3 of 9
(3,621 Views)

@PeterFoerster  a écrit :

My first question would be: Does the smoothieboard support running actual G-Code on it?

Yes. Smoothieboard runs the Smoothieware firmware, which is a G-code interpreter. Any G-code commands sent over serial to the board will be executed by the firmware, resulting in movement or other operations.

It can even run G-code files stored on the SD card. You can also talk to it via http instead of serial if that's something [ not sure what this forum is just got here from a google alert, insert software name ] can do.

0 Kudos
Message 4 of 9
(3,612 Views)
Yes. Smoothieboard runs the Smoothieware firmware, which is a G-code interpreter. Any G-code commands sent over serial to the board will be executed by the firmware, resulting in movement or other operations.

It can even run G-code files stored on the SD card. You can also talk to it via http instead of serial if that's something [ not sure what this forum is just got here from a google alert, insert software name ] can do.


OK, it would seem that I made a mistake in assuming that by G-code, LabVIEW code was meant. The programming language LabVIEW uses is called G, so I didn't go looking for other standards, before replying. Devices outside of the NI product palette that can run LabVIEW code are very few.

 

Is my other assumption right, that you're not actually flashing code onto the device, but rather sending commands to it?

In this case http and serial are both options.

 

I'm not sure about what RavensFan wrote. I always thought, you can add any serial device to max and assign an alias, but that might well be wrong.

Other than that, do what he said: Open an example and see if the com port shows up there.



Remember Cunningham's Law
0 Kudos
Message 5 of 9
(3,592 Views)

Yes, by Gcode, we mean the NIST kind executed by CNC milling/other fabrication machines historically.

 

And yes, you can just send commands over USB/serial, UART/serial, telnet, or HTTP ( /command endpoint, see example web interface ), and they get executed. Don't send a new command until you get an "ok" for the command you just sent ( this is the flow control method ).

0 Kudos
Message 6 of 9
(3,590 Views)

@PeterFoerster wrote:

 

 

I'm not sure about what RavensFan wrote. I always thought, you can add any serial device to max and assign an alias, but that might well be wrong.

Other than that, do what he said: Open an example and see if the com port shows up there.


You can have a Serial port in MAX and assign it an alias.  But LabVIEW and MAX have no idea what is connected or not connected to the other side of the serial cable.

 

While other things like an o-scope connected with a USB cable and with its proper drivers installed, will show up as an actual device.

Message 7 of 9
(3,583 Views)

@RavensFan wrote:

You can have a Serial port in MAX and assign it an alias.  But LabVIEW and MAX have no idea what is connected or not connected to the other side of the serial cable.

 

While other things like an o-scope connected with a USB cable and with its proper drivers installed, will show up as an actual device.


Thanks for clearing that up. This is what I referred to in my first response as I understood the question to be: How can I make my device show up in max, e.g. to use the test panel?



Remember Cunningham's Law
0 Kudos
Message 8 of 9
(3,576 Views)

Awesome, this is all very helpful!  I will keep in mind what y'all said and keep you posted as I have more questions.  I'm extremely new to Labview (started this week), so I don't quite know how to respond to all of your suggestions without trying them first.

 

Thanks!

0 Kudos
Message 9 of 9
(3,563 Views)