LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usb to parallel port converter

hello all finally i succeded.

Now i can write data to usb to parallel port converter.

when ever i give values in first element of array the datas are orderly send to parallel port (i.e)to D0 to D7 .  There is no doubt about it 

but i dont know how to shift the values so that i can run stepper motor through that.  I checked it with led, it is blinking but the time delay is not that much expected. But the value corresponds to seond element is not wrote on the parallel port instead all the other data ports are glowiing with less brightness

 

i am using usb to 36 pin parallel port

i configured it as usb device using driver wizard

 

i need someones help now

 

Thank you

0 Kudos
Message 1 of 20
(8,275 Views)

You are using a 100 mSec delay in you loop.  There is no data in your array but if it was filled I would expect you to see LEDs glowing dimly.  Slow down the delay to 500 of 1000 and see what you get.

 

Also, I see that you have a 2 wired to the loop.  That will execute in 2/10ths of a second so how are you seeing anything???  You're NOT using the run continuous button are you?

 

These changes are good programming practice as well:

untitled.JPG

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 2 of 20
(8,262 Views)

Thank you for your reply nlquist

 

i try to do the vi u have given but it shows some error .

i have attached the screenshot of the vi .

 

i beginer to labview and i dont know how to creat error out indicator that u have given in your screeshot.

 

please reply me why i receive that error (u have connected two terminals different type) although i try to do the same thing that u have done.

 

i used run continiously only

 

and in first vi there is no differece i feel while changing the delay

Download All
0 Kudos
Message 3 of 20
(8,255 Views)

LabVIEW loops can auto index an array.  This is a convenience since you don't have to do it yourself inside the loop (like you did).  It's also good for performance since the compiler can figure out in advance how much memory to allocate.

 

Auto-indexing works both ways; you can process an input array on element on each loop iteration OR you can build an output array of elements that were generated during loop iterations.  For many datatypes the auto-index function is the default but you can always change it if that's not what you want.

 

In your case simply right-click the tunnel on the VISA reference output from the loop and de-select auto index.

 

To create an error in/out you can either drag and drop them from the palette or right click on an ERROR OUT connection on your VI and select Create > Indicator.

 

You will need at least some LabVIEW basics to go much further.  I suggest you take some tutorials: http://www.ni.com/academic/students/learnlabview/

 

BTW, the Run Continuously button is intended for diagnostics use.  It is not designed to loop your code.  You need to build a main loop with a proper stop button.  The tutorials will explain this...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 20
(8,242 Views)

thank you nlquist

 

the same only happening witht new vi also

 

When i write 1, 2, 4  in first, second and third element of array The LED connected with data port corresponds to first element of array only glowing brightly(in this case LED connected to D0 glows and if write 2 in first element then LED connected to D1 glows).  And all other data lines are blinking with same rate dimly.  i tryed to vary the delay but i cannot figure out any difference.

 

0 Kudos
Message 5 of 20
(8,239 Views)

Try this VI where I changed your for loop.  This will allow you to set a value and send it, then check another, etc.  The value you enter and send should light up correctly if your converter is doing what it's supposed to.

 

 

BTW, you're not still using the run continuous button are you???  That will keep looping uncontrolled and will just confuse you.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 6 of 20
(8,232 Views)

Thank you Nlquist

 

It is working. Whenever i give value in write buffer, corresponding LED is glowing brightly and all other LEDs are not blinking even dimly.

So now one of my problem is solved.  But i want  to write different value for each iteration so that i can run stepper  motor with that.

 

How to  do that can u give me vi for that?

 

Now i am not usning run continously button.

 

(But the values are not shifting while program is running evenafter i changed the values in write buffer and pressed the 'send to visa' button.  I have to stop program and give another value in write buffer to shift the LED light.)

0 Kudos
Message 7 of 20
(8,225 Views)

Changing the value and pressing send while the VI is running should change the output properly.  It sounds like your USB to parallel converter isn't doing what you expect.   Try sending a zero between each value to see if it clears the output and allows you to send a new value correctly.

 

Unfortunately, the USB to parallel converter is probably designed to use with old printers and may not implement VISA well.  You may have to get a DAQ card or dedicated stepper driver to move your motor.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 20
(8,209 Views)

hello nlquist

 

I have tryed different combination

 

One of the vi i tryed is working as expected. Will opening and closing VISA cause unpredictable delay.?

 

 I have attached the  VI which i mentioned working earlier.

But still i dont know why it is working. I just added "set timeout"  funtion from visa advanced palette and used run continuously button it causes the four LED to blink alternatively with expected sequence and time delay as mentioned in "set time out" funtion.

 

My aim  is to  give the number of steps to stepper motor so that it can  move to expected position  and stop but, if i give number of steps in N terminal of for loop and run the program(not run continuously here) It stops the loop instantly.

 

Can u please explain why this is happening?

 

As u said i tryed to put 0 before changing the value in your vi it clears the previous value but after putting second value it is not shifting the value(No LED is glowing).

 

0 Kudos
Message 9 of 20
(8,194 Views)

hi i mentioned earlier that 4 LEDs are blinking alternatively.  Its 2 LED and not 4.

 

Adding 3rd  element in array causes  one LED to glow constantly.

 

For checking i have put one indicator before going to write buffer and found, whatever the value comes in that indicator corresponding led only glowing.

 

so if i able to send four values to that indicator alternativelyn  the four LED should blink alternatively so that i can use it for stepper motor.

 

(My adapter is for printing only as i mentioned earlier i have configured it as usb device using NI driver wizard)

 

i have added the screenshot of MAX  see that also.  My usb device is detected under "devices and interfaces "

 

0 Kudos
Message 10 of 20
(8,192 Views)