Dear all,
I recently bought a Labjack U3-LV to get my laptop to communicate with a Digitimer DS5.
The DS5 should send small electric shocks to my participants. Thus, I have a digital input and an analog output.
I connected the DS5 to the U3 through the DAC0 port. The U3 is connected to the laptop through USB.
Following the“Low Levels commands quick start” instructions (https://labjack.com/support/software/examples/ud/labjackpython/low-level), I established communication between the laptop and the DS5. Thus, with the following code, I can set the DAC0 to a fixed voltage:
“” import u3d = u3.U3()
d.getCalibrationData()
DAC0_VALUE = d.voltageToDACBits(1.5, dacNumber = 0, is16Bits = False)
d.getFeedback(u3.DAC0_8(DAC0_VALUE))
“”
Problem is that, although I can set the DAC0 to a specific value, I can’t trigger a shock neither by code nor by the Labjack control panel.
Can a voltage be triggered from the control panel? If not, is there some example code to do this? I think that I should use the eDAC function, but I can't make it work...
In sum, I want to input a specific voltage value, and this should trigger a shock for x milliseconds in output.
Looking forward to your suggestions,
Francesco
I found some email traffic in our support box about the DS5 that is likely with you. The manufacturer told us:
" The DS5 can be set to accept a ±10V, ±5V, ±2.5V or ±1V input signal. It has three output ranges: ±10mA, ±25mA and ±50mA. So, if the input voltage range is set to ±5V and the output range is set to ±50mA, a +5V signal at the voltage input will result in a +50mA current. Likewise a +2.5V signal will give +25mA. Note that the maximum current the DS5 can deliver is 50mA."
Based on that we decided that you would use the built-in channel DAC0 on the U3 which has a roughly 0-5V output range, and you would configure the DS5 as follows:
Input Signal: ±5V
Output Current: ±50mA
Then varying U3-DAC0 from 0-5 volts will vary the output current of the DS5 from 0-50 mA. So ignore timing for now, and just look at does the DS5 current vary from 0-50 mA as you vary DAC0 from 0-5 volts? Use the Test panel in LJControlPanel (on Windows) to easily vary DAC0.
Thanks for the quick reply!
Yes, indeed the DS5 current does vary from 0-50 mA as I vary DAC0. So laptop and DS5 are communicating through the U3... However, varying the current does not trigger/send a shock to the participant.
Maybe your subject is too tough? Just kidding, but I don't understand the problem. Seems like you are saying that the U3 is properly varying the DS5 current output, so I am not sure what is not working?
All solved! Thanks for the great support! :)
Hello!
I have a similar issue. I'm trying to send manual triggers from an HP laptop with the Medoc Medical System software through Labjack U3-HV connected to a macbook which is connected to a Medoc pathway (HP with MMS -> Labjack U3-HV -> Macbook -> Medoc Pathway machine). I am using AIN0. The goal is to able to click a button on the medoc software and then have the macbook print the specified voltage in python. This is what I have so far (gotten from the Labjack website):
d = u3.U3()
d.getCalibrationData()
ain0bits, = d.getFeedback(u3.AIN(0)) #Read from raw bits from AIN0
print(ain0bits)
ainValue = d.binaryToCalibratedAnalogVoltage(ain0bits, isLowVoltage = False, channelNumber = 0)
print(ainValue)
ain0bits, = d.getFeedback(u3.AIN(0))
ainValue = d.getAIN(0)
print(ainValue)
Would I need a python script to connect the labjack and medoc software? And if yes, could you please help me with it?
I don't quite follow. At first it sounds like you are trying to send digital triggers to your machine (U3 digital outputs?), but then you talk about pressing a button in your software and "have the macbook print the specified voltage in python", which sounds like maybe you want to read an analog voltage signal connected to a U3 analog input? Please clear things up for us a bit.