04-13-2015 04:11 PM
Suppose I want to send a clocked data signal out on a pair of digital lines via Labview+LINX+Arduino (or Labview+USB-6008). What's the "best" way to write out a synchronized signal from a vi? Right now, the easiest tool seems like a flat sequence (movie) structure, with one frame per clock cycle. Since I'm just twiddling a pair of bits, is there a text-base way to propagate the signal (ie, via formula or mathscript node?)
If you'd like a concrete application - lets say I want to drive an i2c protocol for a 16bit ADC, and for the sake of learning I don't want to use the canned i2c module in LINX.
Yes, I realize that LINX+Arduino isn't reliable for waits of less than 15ms! I'm mostly just trying to figure out what the best way to write out adigital signal.
Nathan
04-13-2015 06:29 PM
If you want to set bits from text, you might want to switch to a text-based language. In LabVIEW, I would do this using a state machine - a while loop, containing a case structure, with a shift register around the while loop that stores the current/next state. Alternatively, if you can precompute the series of bits to be sent, you could store them in an array, then use a for loop to write them out one at a time with a fixed delay for every loop iteration.
04-13-2015
08:02 PM
- last edited on
03-25-2025
10:35 AM
by
Content Cleaner
If you want to do I2C you need digital lines that can tristate.
The best way to go about this that I know is either:
-8452: https://www.ni.com/en-us/shop/model/usb-8452.html
-LabVIEW FPGA: https://forums.ni.com/t5/Examples-and-IP-for-Software/I2C-IP/ta-p/3491271
-HSDIO Card
The biggest issue you're going to have is that standard DAQ cards either can't tristate their digital lines, or can't tristate them fast enough.
04-13-2015 09:21 PM
04-14-2015 03:24 AM - edited 04-14-2015 03:24 AM
I believe the term "bit banging" implies a software timed system. Sometimes it's good enough.
04-14-2015 07:57 AM - edited 04-14-2015 08:02 AM
I also suggest the state machine. Avoid "movie frames" by using more scalable designs.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord