Questions about Lite version


Recommended Posts

It seems I've fixed the streaming error. Only thing I changed was I had the "using" and "include" in an auto start sequence. Also had it in my streaming sequence. I unchecked the auto start and all seems well. 

As far as the graph sequence goes, I still cant figure out what's wrong. All I get is a straight line at 0. It seems to be something in the mean(filter part. 

If I change the fill to any other number it gives me a straight line at that number so I know that part is working. 

Ive commented out the mean(filter part and inserted a private f=, then did a f= f+ in the loop and I get the correct lines on the graph. 

At times I get a missing parameter message in the alert box pertaining to line 14, which is my mean(filter line. Seems like im not getting data into the array. I've also tried it on a logging set I have, which I load into v channels, and the same results. 

Any idea whats wrong with that line? If I do the sequence on paper it makes perfect sense but it just won't work. 

Link to comment
Share on other sites

  • 1 month later...

Thanks for the great help. I have learned a great deal using DaqFactory. 

My next phase is controlling my vfd using the analog inputs. If I purchase a LJTick-DAC, can I script to change the voltage output numerous times? I’d like to be able to start at 1 volt on A and 2 volts on B, then change to 3 on A and 4 on B, etc until I reach 10 volts. Is this doable?

If I can’t do that I’ll have to go to Modbus and I’m not familiar with that. I don’t know a lot about VFDs,but I assume I need a PLC to control it. Am I correct in that assumption?

If you know any other way I’d appreciate it. 

Thanks Jim M

 

Link to comment
Share on other sites

You can do it from DAQFactory script without a problem.  I used DAQFactory to control nearly 50 DAC's, most through LJTick-DAC's for real time "steam" gauge displays for a flight simulator, and it had no problem.  Here's the utility class script I created.  Its largely a copy of the sample code provided by LabJack for using the LJTick DAC's with DAQFactory.  I didn't bother to update the comments, so they are slightly off, but should still help.  Just run this code once, then you can either set the DAC's individually, or both at the same time (which is faster) by doing something like:

lj.setTicDACB(1, 18, 2.348)

class CLabJack
   function setBothTicDAC(id, output, val1, val2)
         //Tell the driver that SCL is on FIO0.  The driver then assumes that SDA is on FIO1. 
      //This is just setting a parameter in the driver, and not actually talking 
      //to the hardware, and thus executes very fast. 
      ePut(id, LJ_ioPUT_CONFIG, LJ_chTDAC_SCL_PIN_NUM,output,); 
       
      //Set DACA to 1.2 volts.  If the driver has not previously talked to an LJTDAC 
      //on FIO0/FIO1, it will first retrieve and store the calibration constants.  The 
      //low-level I2C command can only update 1 DAC channel at a time, so there 
      //is no advantage to doing two updates within a single add-go-get block. 
      ePut(id, LJ_ioTDAC_COMMUNICATION, LJ_chTDAC_UPDATE_DACA, val1, ); 
       
      //Set DACB to 2.3 volts. 
      ePut(id, LJ_ioTDAC_COMMUNICATION, LJ_chTDAC_UPDATE_DACB, val2, ); 
   endfunction

   function setTicDACA(id, output, val1)
      ePut(id, LJ_ioPUT_CONFIG, LJ_chTDAC_SCL_PIN_NUM,output,); 
      ePut(id, LJ_ioTDAC_COMMUNICATION, LJ_chTDAC_UPDATE_DACA, val1, ); 
   endfunction       

   function setTicDACB(id, output, val1)
      ePut(id, LJ_ioPUT_CONFIG, LJ_chTDAC_SCL_PIN_NUM,output,);        
      ePut(id, LJ_ioTDAC_COMMUNICATION, LJ_chTDAC_UPDATE_DACB, val1, ); 
   endfunction       
endclass

global lj = new(CLabjack)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.