11-28-2015 08:03 AM
Hello.
I'm using myRIO 1900 with LabVIEW (FPGA module) 2013 on Windows 7. I've run out of the number of analog inputs on the controller and desperately need more. I inderstand I'll be needing to use ADC's for this. Other than that I dont know much about what to do.. Could somebody please help with what needs to be done and how exactly to do it ? eg. I know that the SPI and other 'special' pins are going to be used.. but how exactly ?
I know I'm asking a lot, but any help will be greatly appreciated 🙂
Thanks in advance
11-30-2015 03:30 AM - edited 11-30-2015 03:31 AM
You might be able to add a multiplexor chip instead. Most of the NI DAQ devices actually only have one analogue input, but they have a multiplexor which switches which input gets connected to the ADC.
I think these are your options:
- Get a multiplexor chip and use it to connect multiple - you'll obviously get a slower sampling rate as you'll need to switch the multiplexor between reads. The chip might be SPI or it might just take a number of digital input lines to select the input.
- Get an ADC chip as you suggested - it might be SPI or I2C, there might even be Serial ones? You'll need to wire it up as appropriate. An oscilloscope will help you in the early stages to see if you're sending out the right commands to perform a read and whether or not the device is responding. The myRIO SPI VIs should mean you won't need to do any low-level SPI programming.
- You could also use another device like an Arduino to add the extra analogue inputs. The resolution isn't very high though.
Oh - it's also worth noting there is a specific board on the forums for the myRIO
11-30-2015 01:33 PM
I always thought the Arduino option would be an interesting one. Assuming you can get the USB device recognized, and have VISA working with it, the LIFA, or LINX toolkits should just work with any Arduino with the firmware loaded on it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-01-2015 03:54 AM
I hadn't even though about directly connecting the Arduino to the myRIO via the USB (enumerated serial port), but I don't see any reason why it wouldn't work - I've read in a few places that USB to Serial converters can be plugged into the USB port on the myRIO. If that doesn't work, connecting the serial RX/TX pins to the myRIO should work (I think the myRIO serial pins are TTL level rather than RS-232 level).
12-03-2015 07:12 AM
Alright.. But I've got to do it using ADCs for my project.. specifically.. so I'm kinda stuck with that.
12-03-2015 07:38 AM
Well then you need to find a suitable ADC that gives you the resolution & accuracy that you require and with a suitable communication method (e.g. SPI, I2C, Serial/UART) and then read the datasheet in detail to figure out how to build it into a circuit and connect it to your myRIO. You'll then need to read the section on the protocol used (whether it's SPI/I2C/UART) and then see if you can use the myRIO SPI/VISA functions to talk to it - or you might need to write some custom FPGA code that does the communications with the ADC.
12-09-2015 02:38 AM
Yes.. I was hoping i could get more help with this
12-09-2015 03:48 AM
Well once you've got your ADC chip all wired up, and you've written some LabVIEW code for the myRIO to communicate with it but you can't get it to work, then come back to us and we'll help you try to figure out what's going wrong.
We're not going to do your work for you! I've told you the steps you need to take - it's up to you to do the research necessary to complete them!
12-09-2015 05:04 AM
Hey deepen_solanki,
I have had the same problem as I needed a 16 bit ADC. I can only recommend you to use an ADC with UART or USB output as these two inputs are the only one not having to write FPGA code 🙂 as they are not linked to the FPGA. If you take one with SPI (I took one with "SPI compatible") I could share part of my codes with you, although I was not able to test it yet 🙂
So try to get UART or USB interface first 🙂
kind regards
Slev1n
12-09-2015 07:15 AM
Having never used the myRIO personally I can't say for sure, but I didn't think you had to write FPGA code to talk SPI. There is an express VI that you can configure to do SPI communication, and the FPGA code associated with this should already be written.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord