04-17-2014 10:03 AM - edited 04-17-2014 10:04 AM
Goodmorning everyone,
i'm working with a lathe and i'm trying to acquire some sensor data from a turning process. Since it's very difficoult to manually start the data acquisition i wuold like to automatize that process, in particoular i would like to start the acquisition when a determined line is read by the machine.
I'm quite desperate bacuse I really don't know where to begin.
I read something on the internet about a command DPRNT that send a value from the machine to the PC but what i can I use this value to trigger the data acquisition?
Thank you for your help!
Regards,
Lorenzo
04-18-2014 11:42 AM
Hi Lorenzo,
Could you provide a little more information regarding your setup? How are you sending the command from the machine to the PC (serial cable, RS232)? And what hardware are you using to acquire data?
Thanks!
04-18-2014 12:25 PM
Here is a straightforward way to accomplish what you are trying to do, assuming you don't need a hard real-time trigger (G-code would not be real-time).
If your lathe's CNC controller supports general purpose digital outputs, you can command those to assert using the appropriate G-code command. These general purpose digita outputs (and analog too) are intended for things like turining on vacuum, cooling liquid pumps, light towers, and other periferals, but they can easily be adapted to almost any other purpose. Again, this advice will only apply if your CNC caontroller supports these additional controls. They are typically 24VDC, 12VDC, or 5VDC.
On the PC end, you will need a data acquisition device, to capture the trigger, and begin acquiring whatever it is you need to capture at that moment (temperature, RPM, voltage, amps, etc.)
The codes you need will vary from controller to controller. You will need to enter them in by hand where you need the triggers.
M62, M63, M64, and M65 are commonly used for this on some controllers.
M62 ( M62:(EMC2) turn on digital output synched with motion ) M63 ( M63:(EMC2) Turn off digital output synched with motion ) M64 ( M64:(EMC2) Turn on digital output immediately ) M65 ( M65:(EMC2) Turn off digital output immediately )
04-18-2014 01:05 PM
First of all thank you everybody for your answers!
The lathe i'm using is a Nakamura-Tome SC450, FANUC version 21-TB, withthe port RS-232 (port 0). The RS 232 is adaptated in order to end with a usb connection.
I'm using 3 different DAQ devices: NI 9215 A for voltage, NI 9243 for the accelerometer and NI 9219 for the termocouple.
All equipped with NI 9162 USB adapter.
So in total I have 4 usb: 3 sensors and the RS 232 port.
Thanks MoviJHON, I will try your solution!
The method i was thinking to adopt is this:
...
T1212(MULTI TOOL)
G0Z100.X14.
M8
G96M3S100
Z5.
POPEN
DPRNT[STARTDATA1]
PCLOSE
G1Z-8.F.05
POPEN
DPRNT[ENDDATA1]
PCLOSE
G0Z2.
#1=#501-1.
#2=15.
...
The fact is that i absolutely don't now how aquire these string in labview and how to use them to trigger the acuisition of the data!
Regards,
Lorenzo
04-18-2014 02:11 PM
04-20-2014 05:27 PM
I've looked into the serial read and it is just was I was looking for, thanks for the advice!
Just a couple of doubts:
-Since the RS-232 is adaptated to plug into the PC through a USB, while setting up the serial read, in the "Instrument property node" block I should consider it USB or Serial?
-Once that I read the string coming from the machine, I should use a "software" trigger, correct?
Thank you again.
Regards
04-20-2014 05:54 PM
04-22-2014 09:31 AM
Are there any chances that this programm will work?
In the G-code there are 4 commands to send a string, 2 to monitor the time and 2 to start the acquisition.
My main doubt is: if I set the data acquisition for 2 sec, since it is in the case structure, when the condition of true is met the data acquisition should start but it will last 2 sec or just until the condition of true is no more met?
I'm sorry if the question may appear silly to many of you, but before assigning me this task I had never used labview!
Thank for the patience
Regards,
Lorenzo