Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

U6 and LJTick_DAC


  • Please log in to reply
24 replies to this topic

#1 cromda

cromda
  • Members
  • 43 posts

Posted 13 June 2010 - 03:36 AM

Hi, I've a LJTick DAC connected on my U6, wich works fine with the LJTickDAC utility from LabJKack (DAC on FIO0 and FIO1). When I try to drive the DAC with the DAQFactory example downloaded from LabJack website (DAC on FIO4 and FIO5), the DAC don't work and I get an error message in the command window : "(...) Communication error with LJTDAC module, wrong number of ACKs received". The problem remains if I change the LJTDAC slot. Any idea of what's wrong ?

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 16 June 2010 - 10:45 AM

Hi,

I've a LJTick DAC connected on my U6, wich works fine with the LJTickDAC utility from LabJKack (DAC on FIO0 and FIO1).

When I try to drive the DAC with the DAQFactory example downloaded from LabJack website (DAC on FIO4 and FIO5), the DAC don't work and I get an error message in the command window :

"(...) Communication error with LJTDAC module, wrong number of ACKs received".

The problem remains if I change the LJTDAC slot.

Any idea of what's wrong ?


Hello Cromda,

Can you please try the attached example and write back with the result along with your firmware and UD driver version? Both version numbers can be found in LJControlPanel.

Thank you,
LabJack Support

Edit: I think there may have been an issue with the channel event code that has been corrected with this example. Also, to test it, please attach the LJ-TickDAC to the FIO0/1 block. Thanks and I apologize for the confusion -- LabJack Support

Attached Files



#3 cromda

cromda
  • Members
  • 43 posts

Posted 17 June 2010 - 09:33 PM

Thank's for your asnwer, Presently, my DAQFactory software is jamed, because of a copyprotection issue. As soon as It work again, I try the .ctl you sent.

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 18 June 2010 - 08:34 AM

If you want to try it right away, get DAQFactory Express from daqexpress.com.

#5 cromda

cromda
  • Members
  • 43 posts

Posted 19 June 2010 - 02:21 AM

DAQFactory is working again. I tried the file .ctl you sent, just adding a call to errorhandler in the event sequence of DAC_A4 channel (see attached). Each time the DAC_A4 event is called, I get an error message : "Error occured on io type : 506, channel type : 5125, code : 69 : Communication error with LJTDAC module , wrong number of ACKs received" Versions : UD driver : 3.15, Firmware : 1.130 Bootloader : 6.150 Hardware : 2.000

Attached Files



#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 22 June 2010 - 09:58 AM

DAQFactory is working again.

I tried the file .ctl you sent, just adding a call to errorhandler in the event sequence of DAC_A4 channel (see attached).

Each time the DAC_A4 event is called, I get an error message :

"Error occured on io type : 506, channel type : 5125, code : 69 : Communication error with LJTDAC module , wrong number of ACKs received"


Versions :

UD driver : 3.15,
Firmware : 1.130
Bootloader : 6.150
Hardware : 2.000

Hello Cromda,

I did some digging and it looks like you need to upgrade your driver to our 3.20 beta. Please visit this address for instructions: http://labjack.com/s...dows-ud/beta-ud. I also noticed that our testing U6 has a newer firmware (1.50) but I think you should be fine. However, if the program still does not work properly, go to Start > All Programs > LabJack > LJSelfUpgrade to change it. Lastly, I cleaned up the example that I provided for you earlier to use the FIO2/3 block (twos are often easier to find than zeros). Please try using the LJTickDAC on that block instead.

Thank you for your patience,
LabJack Support

Attached Files



#7 cromda

cromda
  • Members
  • 43 posts

Posted 23 June 2010 - 12:47 PM

I upgraded UD driver to 3.20 and now LJTick works fine on FIO2/3 (an on FIO0/1 too). Thank for your help.

#8 rohanstanger

rohanstanger
  • Members
  • 3 posts

Posted 19 February 2014 - 03:07 PM

Hello,

 

Im doing something similar in DAQfactory express and would like to use the U6Pro to control the LJ-DAC on FIO0 & FIO1 pins while also reading 0-5V analogue signals back in on AIN0, AIN1 and AIN2.

 

Im reading just over 10V on all three analogue inputs where the multimeter says it should be 0.  

 

Can you use the FIO0 and AIN0 at the same time?  These appear to have the same channel numbers in DAQfactory though i could be wrong- your webpage only list U3 and U9 for channel number examples.

 

any help would be greatly appreciated

 

cheers



#9 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 February 2014 - 04:01 PM

Yes, you can use FIO0 and AIN0 at the same time.  In DF you specify an iotype and channel number.  So, for example, analog input 0 (AIN0), is different than analog output 0 (DAC0), which is different than digital I/O 0 (FIO0).

 

Does DF read the analog signals correctly without the LJTDAC stuff?  Just open a new CTL and add a AIN channel or two.

 

Does LJLogUD or the test panel in LJControlPanel read the analog inputs correctly?

 

Are you measuring with your DMM from AIN0 to GND, while looking at the AIN0 reading on the computer at the same time?



#10 rohanstanger

rohanstanger
  • Members
  • 3 posts

Posted 19 February 2014 - 11:12 PM

I think I have the gist of the differences between AIN, FIO - I have previously been used to the U3 where they are on the same pins.

 

I have re-checked the AIN values in a new DAQfactory program and they are still reading 10V.

 

However, when I ran LJControlPanel it registered that there may be a calibration problem (G-0.000248/10.115590) on the high speed (not high res) convertor and that I should contact you guys about it.

 

Is it possible that this is my problem?

 

cheers



#11 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 20 February 2014 - 09:44 AM

That is strange.  Connect VS to AIN0 so it should read about 5 volts, and connect GND to AIN1 so it should read about 0 volts.  Then run LJLogUD and look at the readings from +Ch=0/-Ch=199 and +Ch=1/-Ch=199 (which is the first two rows by default).  Compare the readings with resolution index set to 1-8 or 9-12.



#12 rohanstanger

rohanstanger
  • Members
  • 3 posts

Posted 20 February 2014 - 03:04 PM

After connecting AIN0 to VS and AIN1 to GND the LJlogUD program was able to measure those signals with resolution factor 0-8.  At higher resolution settings 9-12 it still measured 10.115590.  I tired changing the resolution factor in DAQfactory but this had no effect.

 

The value of 10.115590 is the same as mentioned in the calibration problem in LJControlPanel.  It was reading this value on the first 4 channels and the GND (I cant remember if it was -ve of not).  When I checked it afterwards I also noticed that the temperature is reading ~ -750 degC.

 

Its starting to sound like an electronic fault.  Should I try re-loading the firmware?  Ive tried the pull USB plug out and replug (my last option). 



#13 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 22 February 2014 - 10:36 AM

You certainly want to try power-cycling the device (disconnect/reconnect the USB cable and have no other connections to the U6 besides USB and the 2 jumpers for AIN0/1), and re-programming firmware is worth a try, but it sounds to me like your high-resolution converter has been damaged.  Contact [email protected] for an RMA so we can check it out.



#14 jhenise

jhenise
  • Members
  • 26 posts

Posted 16 April 2015 - 03:28 PM

Hello, I am running two LJTick_DAC's on my U6-PRO with DAQ factory...

 

I seem to get some cross talk, meaning updating a value on the second LJTick_DAC momentarily updates voltage on the first one

 

 

I am using the output of a PID look to change the voltage of the two DACs.

The first  LJTick_DAC is on FIO4 and FIO5 and the second is on FIO6 and FIO7

 

 

 

I have assigned them individual channel names and numbers in DAQ factory as:

 

DACA_1, channel 0, DACB_1, channel 1 for DAC 1 on FIO4/5

 

DACA_2, channel 0, DACB_2, channel 1 for DAC 2 on FIO6/7

 

In the channel event i have:

 

(for DACA_1)
 ePut(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0)
 ePut(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_1[0],0)
 
 
 
(for DACB_1)
ePut(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0)
ePut(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_1[0],0)
 
 
(for DACA_2)
 ePut(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0)
 ePut(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_2[0],0)
 
 
(for DACB_2)
ePut(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0)
ePut(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_2[0],0)
 
 
if i set the values of the four DACs manually they all set to the desired values, However when i try to set them with my PID loop output i get cross talk.
the PID loops update every 0.2 seconds, and i have all four running, perhaps this is two fast to issue commands to the driver??
 
any help would be greatly appreciated!!
 
 
 

 



#15 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 16 April 2015 - 04:00 PM

I would not expect any crosstalk.  How are you seeing it?  Do you see it on a scope?

 

Perhaps attach a CTL simplified as much as possible that demonstrates the problem.  Or better yet, do you see the problem with LJTDAC_Dual.ctl:

 

http://labjack.com/s...ples/daqfactory



#16 jhenise

jhenise
  • Members
  • 26 posts

Posted 05 May 2015 - 04:09 PM

I see it by monitoring the voltage output of the DACs with analog inputs on the same lab jack

 

the DAC outputs are also hooked up to pressure regulators, so for example:

 

if DACA_1 is set to 10v updating every 0.2 sec this runs the regulator at 100 PSI

if DACA_2 is set to 0v also updating every 0.2 seconds this runs its the regulator at 0 PSI

 

so when the cross talk occurs i see DACA_1 jump to 0v for 0.2 seconds, and this causes the regulator to vent its pressure that is very obvious

 

I found a topic on this forum (https://forums.labja...?showtopic=4327) where the issue was fixed by replacing the two eput commands in the channel event with an addrequest and go command in my case:

 

replacing:

 

ePut(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0)
 ePut(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_1[0],0)
 
with:
 
AddRequest(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_1[0],0, 0)
Go()
 
This solves the cross talk issue however creates another problem.
 
sometimes when i set the variable DACA_1 to a new value in DAQ factory, the voltage on the DAc will not change, it fails to change the voltage about every 10th time i change the variable
 
Any further help would be greatly appreciated!


#17 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 May 2015 - 08:00 AM

Is this still with multiple loops having similar code?  I feel like you have some sort of threading issue:

 

http://labjack.com/s...ers-guide/4.1.2

 

... actually, your issue might better be described as lack of threading.  If the 4 loops execute at the same time, in the same thread, the requests could be mingled such that you don't know the exact order they are all happening.  You might need to post on AzeoTech's forum to discuss solutions, but I will send them a message right now to check this topic:

 

http://www.azeotech.com/board/



#18 jhenise

jhenise
  • Members
  • 26 posts

Posted 06 May 2015 - 11:48 AM

yes there are four analogous loops (DACA_1, DACB_1, DACA_2 and DACB_2), however I get missed updates if i only alter one of the variables at a time.

I suppose all four loops are constantly running though...



#19 jhenise

jhenise
  • Members
  • 26 posts

Posted 06 May 2015 - 12:03 PM

Also as i understand variables in DAQ factory are arrays with a history.

 

sometimes the DAC will update to the previous array value: DACA_1[1] for example rather then DACA_1[0] as the code specifies...

 

So it misses updates and sometimes updates to the previous point in the array



#20 AzeoTech

AzeoTech
  • Admin
  • 323 posts

Posted 10 May 2015 - 10:09 PM

Yes, that definitely sounds like a threading issue, especially if you are updating from multiple threads.  You can never predict when the system is going to context switch.  It could do it between commands or even in the middle of a command.  There is some protection for this, but that protection is more to keep DAQFactory from crashing from a threading issue then solving thread issues in script.

 

I would recommend combining the four loops into one.  It will require a little more logic, but it will eliminate any threading issues.

 

As for variables, variables do not have history unless you explicitly create a history, which is really just an array, either by addressing as an array:

 

x[1] = 3

 

or by using addValue() or append()

 

x.append(3)

 

doing:

 

global x = 4

 

then:

 

x = 3

 

results in x just holding 3.  Subsequently doing:

 

? x[1]

 

will print nothing because x is still a scalar.

 

This is different from output channels, which will automatically build a history.

 

That all said, even the variable problems you are having are almost certainly thread related.


Main Web: www.azeotech.com
Express Web: www.daqexpress.com

#21 jhenise

jhenise
  • Members
  • 26 posts

Posted 11 May 2015 - 11:49 AM

I tried combining the loops into one. instead of using four channels I put code in the event of  a single channel to control all four DACs (see below)

 

AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_1[0],0, 0)
Go()
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_1[0],0, 0)
Go()
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_2[0],0, 0)
Go()
AddRequest(ID,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0, 0)
AddRequest(ID,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_2[0],0, 0)
Go()
 
where DACA_1 is a channel, and DACB_1, DACB_2, and DACA_2 are global variables.
 
However this doesn't work. it seems like I need each variable to be a channel in order for components to set the channel value, for example:
 
channel: DACB_1
 
with event code:
 
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_1[0],0, 0)
Go()
 
however this doesn't work with 4 analogous channels due to the threading issues
 
maybe i am going about this all wrong?
 
Any further help would be greatly appreciated!


#22 AzeoTech

AzeoTech
  • Admin
  • 323 posts

Posted 11 May 2015 - 01:31 PM

I'm not sure.  There is likely other stuff going on in your app that's not apparent in your posts.  I would start by creating a blank application.  Don't create any channels, just declare four variables.  Then create a script to update the four dacs from those four variables, basically the script you posted.  It should work perfectly.  Once you've proven that it can work, you can go through your app and figure out what's different.  Always start simple.


Main Web: www.azeotech.com
Express Web: www.daqexpress.com

#23 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 11 May 2015 - 04:08 PM

I'm pretty sure you want to use a sequence, not event.

 

Also, you could get some confusion because some of your calls are passing "2" for D# and others are passing "ID".



#24 jhenise

jhenise
  • Members
  • 26 posts

Posted 13 May 2015 - 03:22 PM

Sorry the "2" vs "ID" thing is a type here, ID is a variable that = 2 in my DAQ factory app.

 

Sounds like what I haven't done is run the code from a sequence rather than a channel event.

 

I will give that a go...



#25 jhenise

jhenise
  • Members
  • 26 posts

Posted 14 May 2015 - 09:01 AM

Success!

 

placing the code in a sequence loop rather than individual channel events works perfectly, and in my complicated multi-functional DAQ factory application.

 

I run a loop at a frequency of 10 Hz, where DACA_1, DACB_1, DACA_2, and DACB_2 are variables. All four DACs update flawlessly with no cross talk :

 

while(1)
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_1,0, 0)
Goone(2)
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,4,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_1,0, 0)
Goone(2)
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACA,DACA_2,0, 0)
Goone(2)
AddRequest(2,LJ_ioPUT_CONFIG,LJ_chTDAC_SCL_PIN_NUM,6,0, 0)
AddRequest(2,LJ_ioTDAC_COMMUNICATION,LJ_chTDAC_UPDATE_DACB,DACB_2,0, 0)
Goone(2)
delay(0.1)
endwhile
 
Thanks for the help!



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users