From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQdx and DAQmx Communication

Hi Guys.

 

This is my first post on here and im still at the very, very early stages of learning Labview but I have a few questions if somebody could kindly help me out.

 

I've recently created a small program using DAQmx functions to control a small unipolar stepper motor using a USB6008 DAQ and a stepper driver chip. This motor controls a small conveyer. At a point along the conveyor I want a proximity sensor to detect an item and stop the movement of this conveyor and at the same time i need this action to send a signal to an IMAQdx VI to take a snap shot using an attached USB camera. I am using the vision assistant VI to identify a certain colour from the snapshot. If the the colours match i then want to restart the conveyor. If they do not match i want turn on a simple LED.

 

To better explain I will list my problems.

 

1. How do I use the input from the prox sensor to halt the while loop in which i have the software times pulses for the the motor stepping and how do i make this input start a loop in which i have the IMAQdx VI's in order to start the snapshot?. Is it possible to make loops wait for an input as opposed to starting automatically when i press the run button. 

2. When i get a match found output from the vision assistant, how do I restart the the stepping loop for the motor?.

3. Am i going about this the completely wrong way?.

 

I understand that this is probably way to general a question but if anyone has any idea on how to help it would be much appreciated. 

 

0 Kudos
Message 1 of 3
(2,175 Views)

Just bumping this as im too eager to keep moving forward with this  . 🙂

0 Kudos
Message 2 of 3
(2,165 Views)

Hello Banjo B,

 

I can see that you have had no responses to your post so let me help you out.

 

How are you driving your stepper motor? Are you using a PWM signal, or is it simply an On/Off signal to your drive?

I would say that in general it is preferable to stay inside the loop and control your DAQmx task, rather than exit the loop when you want to stop your conveyor belt and then find a way to restart it. So in this situation we would probably use parallel loops or a state machine (you can read more in articles on our website like this one: Standard State Machine), but since you mentioned you are new to LabVIEW, it might be preferable to try a simpler approach.

 

You can have your image acquisition to be the main element of your code, and possibly have a case structure where you output the normal conveyor belt movement (whether it's a PWM or a digital signal) when there is nothing in the image, and then send a stop to the belt when there is. This stop can be in the second case of the case structure and the trigger from the image acquisition can be the decision maker of which case to execute. Addition: you can add the snapshot code in the case where you stop the conveyor belt.

 

Does this help a little? If you have more questions please don't hesitate to ask, and you can also post your code so that we can help further.

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 3 of 3
(2,146 Views)