Hi so once again I need a little guidance on setting up a sensor on the T7. This time its a hall effect sensor for the measurment of RPM. I have seen examples using some other devices but I was only able to get the basics of what I need to do. What I would like to know is if you have any ideas how I can do this using the T7.
Thanks for any help.
First, is the hardware working? Perhaps you can rotate your system very slow and see if the DIO you are using reads high and low at the appropriate times? For this test you can just watch the DIO on the Dashboard in Kipling.
Do you want to count the pulses over time or time individual pulses?
http://forums.labjack.com/index.php?showtopic=1105
Probably the latter, but start with the former as it is another quick way to see if the system is working right:
https://labjack.com/support/datasheets/t7/digital-io/extended-features/h...
https://labjack.com/support/datasheets/t7/digital-io/extended-features/i...
For timing, you will probably use the Frequency In mode instead:
https://labjack.com/support/datasheets/t7/digital-io/extended-features/f...
For any of these, the sections above should describe which registers to write and read, and the Register Matrix in Kipling is a good way to try that out.
Hi so I used the frequency mode and configured as below.
DIO_EF_CLOCK0_ENABLE = 1
DIO0_EF_ENABLE = 0
DIO0_EF_INDEX = 3
DIO0_EF_ENABLE = 1
I have then ran a loop reading DIO0_EF_READ_A and I am able to read a frequency by repeatably passing a piece of metal over the hall sensor.
My problem now is that the frequency displayed is several orders of magnitude higher than what I am doing. Have I perhaps missed a conversion factor from the value read by DIO0_EF_READ_A? or is this the period I am reading?
Any jelp would be great,
Thanks.
Yes, READ_A is the period in ticks. For example, if your clock was 80MHz, and your signal frequency was 10Hz, this would read 8000000. Use READ_A_F to get period in seconds, and then you can take 1 over that to get frequency in Hz. The different Read values are described here:
https://labjack.com/support/datasheets/t7/digital-io/extended-features/f...
If the period/frequency still does not seem right, go back to testing with the simple counter. This lets you see raw counts so you can see if you pass the metal over 10 times do you get 10 counts.
Hi, I have that working now thanks. One more question, I am trying to use multiple sensors simultaneously and with my current method of opening a connection, setting the configurations then closing isn't working as I am just overwriting previous configurations for each sensor. I do believe the T7 is capable of mutiple connections at once I am just a little unsure on how to do it, if you could once again give me a little guidance that would be greatly appreciated.
Thanks,
Stuart.
I'm not quite following. Perhaps provide an example? For example, if you want to use 2 frequency inputs, post a list here of the registers you are going to write to configure them and we can see if that looks good.
What I am actually trying to do is control s servo motor (the one you helped me with earlier) with a potentiometer. I have both the potentiometer and the servo working seperately but when I try to make a vi that includes the control element for the servo, which includes a read and write from the labjack device, they both just stop working as soon as the vi starts.
My question was is there a specific way to include both a read and a write vi, or even two read/write vi's?
Stuart.
Here is a screenshot of the general idea, apologies for messy work.
https://www.dropbox.com/s/nzh1p3uy2buexzo/Screenshot.png?dl=0
Thanks.
When I click your link it says "this image failed to load", so I can't see it. You should be able to attach a file here, but it was not showing up before. Web guys just fixed that so you should be able to attach a file now.
The most efficient way to do writes & reads at the same time is with LJM_eNames2D.vi (see it used in SPI.vi) or even more efficient is LJM_eAddresses2D.vi (see it used in C-R Speed Test.vi). Those can combine writes & reads into a single low-level packet, but can seem a little complex with all the arrays, so a simpler method is a call to eWriteNames and eReadNames which results in 2 low-level packets. I attached a couple examples.
This is my current attempt to which is not working. I know my servo and potentiometer work independently but the potentiometer is not being read by the vi I have madem, any ideas?
Stuart.
Previous to my last comment, could it be a computer related problem as when I start the vi it almost crashes my pc and if i restart labview and reconnect the T7 it will work for a few seconds but then 'not respnd' and it will stop working. I do plan to get another pc to run this off but I now think this old one might not be enough.
Stuart.
We just have LabVIEW 7.1 (for compatiblity reasons), so can't open your LV14 VI. You will have to post a screenshot for us to look at it.
Causing your computer to crash is not normal at all. Even with very old computers, I would not expect problems as we are not doing anything very intensive. Do any of our examples do that, or just your VI?
It is just my vi, so probably not the computer then. The screenshot is attached.
Thanks,
Stuart.
What are the typical values you are seeing for AIN0?
I recreated your VI in LV71. Try the attached and see if it causes problems for you, as it runs fine for me, but perhaps it depends on:
A. How DIO-EF is configured?
B. Interval?
C. What AIN0 reads?