10-21-2013 10:07 AM
Hi all friends,
i am relatively new in labview, and sorry in advance if i ask something very silly.
i am writing this to seek help for absolute encoder data acquisition.
The DAQ set i am using is NI USB-6218 BNC which has 8 digital inputs.
The absolute am using is ACE 128, data sheet is http://www.bourns.com/pdfs/ace.pdf
I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8
and then i am using DAQ Assitant 8 times he input and then convert it to decimal numbers and save it to a text file.
attached is what i have.
it seems that it works well, but however when i look through the text file, i found that there are a lot of errors in the decimal numbers.
can anybody help me to figure out why it happens??
Thank you very much
10-21-2013 01:16 PM
The problem I see is that you are essentially sampling each channel at different times. Differential encoders work by sampling ALL of the channels at the SAME time.
What you you are doing now is sampling each channel one after the next. If your encoder position changes at all in the middle of that sampling stream, you will get errors.
Try changing your code so that you are sampling the entire port at once instead of individual channels.
10-21-2013 08:04 PM
Hi BFeigum,
Thank you very much for your reply.
So you mean that the DAQ assistant works in such a way that it reads value one after another? Therefore the reading of the 8 digital input is not done at the same time.
can this problem be solved by using one DAQ assistant instead of 8? But if that, how can i split the readings and convert to the decimal numbers?
Thanks in advance and hope to hear from you!
Best regards,
Melvin
10-21-2013 08:14 PM
Boolean Array to Number in the Boolean palette.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
10-21-2013 08:20 PM
Thank you for the recommendation! I am going to go through them soon!
Best Regards,
Melvin
10-22-2013 10:18 AM
Hi,
sorry for bother you again.
I have changed the program a bit. instead of using 8 DAQ Assistant, i just use one DAQ Assistant to get all 8 digital input, and then i use the bollean Array to number function and output it.
However, there are still a lot of errors in the output file.
if you compare http://www.bourns.com/pdfs/ace.pdf with the attached output file 123.lvm
i hv attached the vi also.
can suggest why it happens?
Thank you very much !
Best regards,
Melvin
10-22-2013 10:19 AM
sorry, see attached
10-22-2013 11:02 AM
I still see 8 DAQ assistants in your VI, not 1.
I don't see where you used boolean array to number.
Your text file looks just fine. It has lots of numbers in it. I don't see any errors.
So what are the errors that you claim to be getting?
10-22-2013 11:30 AM - edited 10-22-2013 11:41 AM
@melvinfeng wrote:
Hi all friends,
i am relatively new in labview, and sorry in advance if i ask something very silly.
i am writing this to seek help for absolute encoder data acquisition.
The DAQ set i am using is NI USB-6218 BNC which has 8 digital inputs.
The absolute am using is ACE 128, data sheet is http://www.bourns.com/pdfs/ace.pdf
I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8
and then i am using DAQ Assitant 8 times he input and then convert it to decimal numbers and save it to a text file.
attached is what i have.
it seems that it works well, but however when i look through the text file, i found that there are a lot of errors in the decimal numbers.
can anybody help me to figure out why it happens??
Thank you very much
im confused when you say...."I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8", thats not truly a correct statement?
8 inputs is a port( line0:7)....
look for the example in the \examples\DAQmx\Digital Input\Digital - SW-Timed Input.vi (change the example data format to decimal output)
and i dont know if you want to write the data continuous or only when changed to the file?
10-22-2013 02:55 PM
According to page 2 of the data sheet, the output is Gray coded.
I do not see a Gray to binary conversion in your VI. Is this what you expect?