vultac Posted November 24, 2008 Report Share Posted November 24, 2008 Hi i just bought a DAQ from measuring computing and would like to use the usb-1208fs on labview. Is there any websites which are useful for me? As i know programming labview using measuring computing daq differs a bit from NI! thanks! Quote Link to comment
Dan DeFriese Posted November 24, 2008 Report Share Posted November 24, 2008 QUOTE (vultac @ Nov 23 2008, 05:43 PM) Hi i just bought a DAQ from measuring computing and would like to use the usb-1208fs on labview. Is there any websites which are useful for me? As i know programming labview using measuring computing daq differs a bit from NI! thanks! http://forums.mccdaq.com/ Quote Link to comment
vultac Posted November 25, 2008 Author Report Share Posted November 25, 2008 hey how can i represent something like this on labview? 8 D I/O lines. Let D0 & D1 be pulses and D2 - D7 as digital lines Start -> set D0 active high -> set D1 active high -> wait -> Set D0 active low -> wait -> set D1 active low -> finish. Quote Link to comment
asbo Posted November 25, 2008 Report Share Posted November 25, 2008 QUOTE (vultac @ Nov 24 2008, 10:45 AM) hey how can i represent something like this on labview?8 D I/O lines. Let D0 & D1 be pulses and D2 - D7 as digital lines Start -> set D0 active high -> set D1 active high -> wait -> Set D0 active low -> wait -> set D1 active low -> finish. You can use the sequence structure and the Wait (ms) function to accomplish this - but you'll have to read up on how exactly to communicate with your particular device. Quote Link to comment
vultac Posted November 25, 2008 Author Report Share Posted November 25, 2008 thanks mate. another question..ive only been able to configure the bit number..and since i have 8 DO 2^8 = ....256....how isit possible for me to only control the first two digital lines (D0,D1) isntead having to deal with bit numbers? Quote Link to comment
jdunham Posted November 25, 2008 Report Share Posted November 25, 2008 QUOTE (vultac @ Nov 24 2008, 11:22 AM) thanks mate. another question..ive only been able to configure the bit number..and since i have 8 DO 2^8 = ....256....how isit possible for me to only control the first two digital lines (D0,D1) isntead having to deal with bit numbers? DAQmx can control one line at a time with different tasks, but it wouldn't surprise me if mccdaq can only read and write the 8-bit port in one shot. In that case you'll need to read up on http://en.wikipedia.org/wiki/Mask_(computing)' rel='nofollow' target="_blank">bitmasks The basic operation is to read the port (the byte), pick the mask which will change the state as desired, and operate on the byte value, and then write the result back to the port. In LabVIEW you don't have to do this with an array of booleans. The Boolean operators work just fine on integers and work like they would in C, that is, they operate on each bit independently. To avoid race conditions, you need to protect the read-modify-write operation with a mutex, which can either be wrapping this change in just one subvi (you can perform the operation in multiple places, but it has to wrapped in a common subvii) or else by using LabVIEW semaphores. If your whole application is a big state machine or a big sequence you may be able to guarantee that only one operation can be tried in parallel, but relying on that is not recommended. Quote Link to comment
vultac Posted November 26, 2008 Author Report Share Posted November 26, 2008 okay.....thx...im a little lost tho....well i was able to set D0 and D1 to go high and low...but its the timing now thats giving me a headache...well ive attached a jpeg of my progress so far~ struggling with the wait(ms) vi :/!! Well the pic ive just attached basically shows me making 00000001(D0) go active high then making it go active low...thinking about how i could make D1 go active high when D0 is halfway through being active high.... Quote Link to comment
jdunham Posted November 26, 2008 Report Share Posted November 26, 2008 QUOTE (vultac @ Nov 25 2008, 04:19 AM) okay.....thx...im a little lost tho....well i was able to set D0 and D1 to go high and low...but its the timing now thats giving me a headache...well ive attached a jpeg of my progress so far~ struggling with the wait(ms) vi :/!! Well the pic ive just attached basically shows me making 00000001(D0) go active high then making it go active low...thinking about how i could make D1 go active high when D0 is halfway through being active high.... I would work on the bitmasks first, so you can set any desired bit without setting any others (see earlier post). Then I would make that into a subvi so that it's easy to reuse. Only after that I would worry about the timing. How do you want to store the timing pattern? Are you going to make a pattern of ones and zero at some regular interval, or are you going to have a list of durations and the desired state for each one? There is no single right way to describe your waveforms; just try to pick the easiest way that is still useful. Quote Link to comment
vultac Posted December 1, 2008 Author Report Share Posted December 1, 2008 thanks guys!! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.