Hello,
I am streaming values out using the stream out buffer for DAC0. The DAC0 output ranges from values 0V to 5V(typically).
So what values are needed to be given as data points to the DAC0 (using the stream out buffer as I am writing values to STREAM_OUT0_BUFFER_F32).
My question is, are these values the voltages(0 to 5) or digital values (ranging from 0 to 4096 as DAC0 is a 12 bit DAC)?
Thanks,
Rohan L
If you ware writing to STREAM_OUT0_BUFFER_F32 then the T7 will run the values through the calibration constants to get the binary value that the DAC should be set to. So the values passed to STREAM_OUT0_BUFFER_F32 are voltages. When using the U32 and U16 registers the provided values will be sent to the DAC unaltered.
Thanks for your reply,
Just to clarify what you said, please let me know if the following statements are correct, and answer some of them:
-> So DAC0 output for T7 ranges from 5V(~4.97) to 0V. So if I send a value of 2.5 to the STREAM_OUT0_BUFFER_F32, I get a voltage output roughly near 2.5V.
-> What is the maximum resolution of voltage values passed to STREAM_OUT0_BUFFER_F32 (since float 32 is for binary values, not for voltages)? Conversely, if I am sending voltages(decimal values) to STREAM_OUT0_BUFFER_F32, how do I interpret STREAM_OUT0_BUFFER_SIZE_BYTES (mentioned as 512 bytes in the datasheet)?
-> To get a better waveform (low noise and resolution), which one is better - sending voltage values to STREAM_OUT0_BUFFER_F32 or sending binary values to U32 and/or U16.
Thanks,
rohanl
"So DAC0 output for T7 ranges from 5V(~4.97) to 0V. So if I send a value of 2.5 to the STREAM_OUT0_BUFFER_F32, I get a voltage output roughly near 2.5V?"
That's correct.
"What is the maximum resolution of voltage values"
The T7 has a 12-bit DAC. So ~5V / 2^12 bits = 1.22 mV / bit. The buffer size will default to 512 bytes, but can be changed if necessary. The Stream_Out buffer is 16-bits wide, so a 512 byte buffer will hold 256 values.
"To get a better waveform..."
Neither. The only difference is that sending binary values saves the T7 a little CPU time. The math is the same whether it is done by the host computer or the T7.
Hello,
I would appreciate if you give me some guidance as to how to use the stream out0 buffer using a LJTick DAC0 output expansion module.
I want to stream voltage values (now in +ve and -ve voltage ranges) to the DAC0 using LJTick module.
Is it possible to use the stream buffer to do the same?
Thanks,
Rohan L
Stream-Out cannot be used to update the outputs on an LJTick-DAC. The available targets are listed on the following page and are just your basic DAC and DIO registers.
https://labjack.com/support/datasheets/t7/communication/stream-mode/stre...
Also, the Waveform Generation App Note is related to this topic:
https://labjack.com/support/app-notes/waveform-generation
Ok. Thank you so much.
So from this information, do I conclude that waveform generation using a DAC is not possible using a LJTick module?
If not, is there an alternative to generate a waveform (in positive and negative voltage range) by sending values to the LJTick fast enough(typically every 5 msec).
Appreciate your help.
-Rohan L
Referring to the Waveform Generation App Note, you cannot use the "Stream Output" technique to update the LJTick-DAC, but you can use the "Software Timing, Command-Response Updates" technique to update the LJTick-DAC and create a waveform. Your suggested update rate of 5ms is possible for the software timed technique.
Ok. Thank you.
Can you suggest a few URLs to the "Software Timing, Command Response Updates" technique to update the LJTick DAC to create a waveform?
Thanks,
Rohan L
What are you using for software?
The LJTick-DAC datasheet shows you a line of code that updated the value of an LJTDAC channel:
https://labjack.com/support/datasheets/accessories/ljtick-dac
err = LJM_eWriteName(handle, "TDAC11", 7.5)
You just need to put that command in a loop with the timing you want and feed it your values that will create the waveform you want.
Hello,
On which block can we connect a LJTick DAC module to use more than four TDAC addresses? In other words is there a way to connect more than two LJTick DAC modules to a single T7 pro?
Since on a T7 pro there are only two blocks with FIO0/1 and FIO2/3, so 0 and 2 would correspond to all even TDAC# and 1 and 3 would correspond to all odd TDAC#.
Thanks,
Rohan L
You can use any pair of DIO0-DIO19 (FIO0 to CIO3) to connect up to 10 LJTick-DACs which gives you 20 additional analog outputs:
https://labjack.com/support/datasheets/accessories/ljtick-dac
https://labjack.com/support/datasheets/t7/digital-io
https://labjack.com/support/datasheets/t7/db37
https://labjack.com/support/datasheets/t7/db15
You can even use the MIO lines to allow an 11th LJTDAC, but not so convenient.
I need help with accurate timing output on LJTick module. I am sending voltages to the Labjack which are in the range of +/- 5V to create a waveform. I am using LJM library since the project is mainly python based.
However, consecutive voltage samples sent to the LJTick have to be spaced by 5 ms(with minimum error). Since I cannot use stream out buffer(which is having really good timing accuracy)with LJTick, I am using delays for 5 ms interval between sending two voltage samples to the LJTick. I can either use a delay provided by python (time.sleep() or equivalent, which is not accurate below 15 ms) or use WAIT_US_BLOCKING.
But the WAIT_US_BLOCKING gives a variable delay depending on which machine the script is played, (as the command is in between other commands which are processed at different rates by the python interpreter), and this is not as accurate as streaming method.
Is there a way to generate a waveform on a LJTick with timing accuracy of the streaming method? Or do consider this as the ultimate shortcoming of T7 pro?
Please let me know my options.
-Rohan
Software timed 5 ms intervals are pretty reasonable on Windows in general, so sounds like you might be hitting some limitations of Python interval timing. Perhaps there are some better timing methods available for Python to get decent 1 ms resolution?
Note that if the only reason you are using the LJTick-DAC is to get negative voltages, you could add a level shifter circuit to the output of one of the built-in DACs on the T7 instead, and then you could use the Stream-Out functionality:
https://labjack.com/support/datasheets/u3/hardware-description/dac/typic...
Another option to consider is using a Lua script to update the LJTick-DAC every 5 ms.
Hello,
Based on your previous reply, can you please elaborate how a Lua script can be coupled to a python script running on the PC to update the LJTick DAC every 5 ms?
Since my voltage values going to the labjack are held in a list in a python script, is there a way to load the Lua scipt with those values through python to update the LJTick DAC?
Thanks,
Rohan L
See "Passing data into/out of Lua":
https://labjack.com/support/datasheets/t7/scripting
Its not trivial, but once you get comfortable with Lua scripting it sounds pretty reasonable. You would probably use a USER_RAM_FIFO register to sent the list from your Python app to the Lua script, and then have the Lua script step through the list to update DAC0 every 5 ms.