• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Email attachments

    It is most likely an issue with your server. Are you getting an error message? Are you able to send without attachments? Here's the code I used to test (xxx's replacing details that shouldn't be posted): email.strHost = "" email.strUserName = "xxxxxxxx" email.strPassword = "xxxxxxx" email.strAuthenticate = "AuthLogin" email.strBody = "test" email.strTo = "" email.strReplyAddress = "" email.strFile = "c:\trimtable.csv" email.Send() This worked perfectly.
  2. My first guess is that you set the ID of one of the devices to 0. You cannot use the 0 ID or 0 D# if you are using more than one LabJack. Otherwise it does first found and likely is finding the same labjack twice. Thus, its unable to claim that labjack and you are only getting a couple of them working at once. So, just to restate: You can only use D# 0 or ID #0 if you are using a single LabJack. This applies to all LabJacks under DAQFactory including the U3 and UE9.
  3. There are two separate issues here: 1) Timer fields are always 0 There are two issues here: 1st, you initialize timer 0 to mode 10 and then reinitialize it to your other mode. I think you want to put a 1 for channel in your AddRequest() line. Also, there is a firmware issue because the timer used to trigger the stream overrides the system timer and so even once you change that, you'll simply get the same number over. The LabJack guys have fixed this and posted a beta firmware update at: I'll leave it to them to comment on this. 2) The amount of data captured in the file is indicating the data rate is only about 100Hz, not 1kHz. Just to recap from a different post: When doing external triggering DAQFactory is unable to determine the exact time of the trigger. This is because the data comes in in blocks of 16, so except for the last point, it has no idea what the other times are. In fact, it doesn't really pay attention to the fact that you are external triggering, and simply assumes you are sampling at whatever stream rate you specified. In your case, you didn't specify any, so it used the default 100hz rate. So, all your data is spaced at 100hz. This is why Jon is reading the system timer: to get the actual data point time. Now the effect on logging: since you data is being spaced at 100hz, but the real data is around 1khz, the data being logged quickly gets assigned times that are in the future. Because of the way Logging Sets work to align data, this will cause the future data to queue up in memory until that future time arrives or you stop the logging set, which is why it appears not to work. The solution: if you are doing external triggering, send the LabJack the normal stream frequency command: LJ_chSTREAM_SCAN_FREQUENCY, before setting up the rest of streaming. The value you should set to should be larger than the fastest possible stream rate. This will ensure that all the data remains in the past.
  4. AzeoTech

    unknown error-codes

    Good, then it sounds like you understand what Wait() is for. Note that with the U12, DAQFactory can't really do precise timing that it can do with other devices (including the other Labjacks). This is because of the USB library used by the U12. As for your problems, we are still unable to reproduce it. Perhaps the LabJack guys could give it a try and see if they get the same issues? The DAQFactory U12 driver hasn't been changed in years and thus is quite stable. I don't think the U12 drivers have changed in a while either and I haven't heard of these issues with others. My guess is that something on your computer is causing this problem. Perhaps you have another device on an USB port that is occasionally pulling just over the power limit on the port? There are a lot of interactions between devices plugged into a PC that are not competely obvious. This is largely because motherboard manfacturers try to put multiple subsystems on the same bus or power supplies instead of isolating each one. It could also be radio interference, or it could just be a defective U12. Have you tried the U12 on other computers? In other locations (i.e. a different building)? Have you tried using LJLogger instead of DAQFactory?
  5. AzeoTech

    Vista Hard Key Support

    The manufacturer of the hardkey has released a beta for this. I believe the only issue now is that it will show up as an unsigned driver. They are working on getting it signed and expect it in a few weeks. You can go to to download this version. You want the MPI version, not the SmarxOS version. We have not tested it so can not guarentee that it will work.
  6. You can't do this. First, its not possible with DAQFactory, and second you probably don't want to do it anyway. The real question is why your labjack still gives these errors. This is not typical and indicates something is wrong. First, update everything to the current versions. Go to and for the latest. Next, try rebooting, then starting DAQFactory Express before starting anything else, then create a new document and add a few channels and see if you still get these errors. If you do, then reboot and try the LabJack tools like LJLogger and see if they give the same issue. If you don't get errors within Express then you are doing something weird in your document, or you are quitting DAQFactory and restarting without giving the first instance a change to shut down. The other possibility is that you have an ljackuw.dll in your DAQFactory directory and its not getting updated when you update the labjack drivers. If you do have this file in the DF directory, delete it after quitting DAQFactory.
  7. AzeoTech

    button to start logging

    Just change the if section: if ((switch[0] == 1) &amp;&amp; (volt[0] &lt; 1.5) beginlogging(log) endif if (volt[0] &gt;= 1.5) endlogging(log) endif This means if the switch is pressed and voltage is < 1.5 it will start the logging set. If the switch is released, the logging set will stay running. If you don't want that, change the endif / if(volt[0]..) lines to an else: if ((switch[0] == 1) &amp;&amp; (volt[0] &lt; 1.5) beginlogging(log) else endlogging(log) endif If the switch is pressed and the volts goes >= 1.5 the logging is stopped no matter what.
  8. AzeoTech

    edit box

    Use a global string variable that is set by the edit box: global string filename Make sure Set on Submit is set in the edit box. Then, create a button that changes the file name and path to the one specified. The button would have two actions, the first does Submit. The second is a quick sequence with: logging.loggingset.strFileName = "c:\mypath\" + filename
  9. AzeoTech

    parallel traces in a graph

    Sorry, I don't really understand what the problem is. As for your variable question, you have to declare the variables somewhere. Just do: global way_cal global force_cal As for the graph itself, one idea is that you could offset the cal by a little bit. Alternatively, you could make the cal display on the right axis and in point mode, and the real trace in line mode on the left axis.
  10. AzeoTech

    unknown error-codes

    First, I'd make sure you have the latest versions of everything. Go to to get the latest DAQFactory Express. Go to to get the latest LabJack drivers. Next, does this happen after you stop DAQFactory and restart only? If so, DAQFactory may not be shutting down completely before you restart. Run task manager and look at the process tab and make sure you DAQFactory doesn't show up. From your document I don't see anything wrong, at least not in the channels. You have a lot of script and its not properly indented so I couldn't check that. The one thing I noticed is that you use wait(). I recommend using delay() unless you are sure you want the feature of wait() and understand its use.
  11. Certainly, just add a delay inside the for loops: for (private.c = 0, c &lt; 5, c++) read(Eingang0) delay(0.1) endfor
  12. Well, it depends on whether you want to log the averaged data or not. If you just want to make your graph look better, use the boxcar() function as the expression for your graph. Boxcar is only designed for use with an array of data that you want reduced to a smaller array. If you want everything, including logging, to be averaged, you really want the mean() function because you want to take an array of data and get a single averaged point. To use it, you'd have to accumulate some values: private m1 = 0 private m2 = 0 private count = 0 while (1) count++ DigitalOut = 0 read(Eingang0) m1 += eingang0[0] if (count == 5) Motor01.AddValue(m1/count) m1 = 0 endif delay (30) DigitalOut = 1 read(Eingang0) m2 += eingang0[0] if (count == 5) Motor02.AddValue(m2/count) m2 = 0 endif delay (30) endwhile This assumes you still want to alternate readings. If instead you want to read eingang rapidly and then have it put the average in motor01 do something like: while (1) DigitalOut = 0 for (private.c = 0, c &lt; 5, c++) read(Eingang0) endfor Motor01.AddValue(mean(eingang0[0,4])) delay (30) DigitalOut = 1 for (private.c = 0, c &lt; 5, c++) read(Eingang0) endfor Motor02.AddValue(mean(eingang0[0,4])) delay (30) endwhile
  13. AzeoTech

    unable to load file!!!

    99.9% of the time this happens when you try to load a document created with a newer version of DAQFactory with an older release. Make sure your new computer has the latest release by downloading an update from If that doesn't fix it then the file got corrupted at some point, probably due to disk error, which is why backups are so important.
  14. AzeoTech

    graph control with edit box or button

    I'm a little unsure what the problem is. If you don't have an else, just don't put one: if (System.MessageBox("Do you really want to stop?","YesNo") == "Yes") Mychannel.ClearHistory() endif
  15. Yes. First you have to name your graph: select the graph and right click and select "Component Name...". Lets say you call it MyGraph. Next, you need to put a trace on the graph for your initial channel. You'll need to name the trace. This is about half way down on the trace page. Now you can change the Y expression programmatically: Component.MyGraph.MyTrace.strYExpression = "V.Motor5" There are a variety of components: combo, radio, button, etc. that can be used to actually set this value.
  16. AzeoTech

    graph control with edit box or button

    Just use an if to see what the current expression is: if (Component.MyGraph.MyTrace.strYExpression == "V.Motor5") Component.MyGraph.MyTrace.strYExpression = "" else Component.MyGraph.MyTrace.strYExpression = "V.Motor5" endif This will toggle the graph display between V.Motor5 and nothing.
  17. AzeoTech

    graph control with edit box or button

    Sure, lets say your sequence is MySequence and you named your button MyButton. In the quick sequence action for the button put: if (Sequence.MySequence.Running) if (System.MessageBox("Do you really want to stop?","YesNo") == "Yes") endseq(MySequence) Component.MyButton.BackColor = RGB(0,0,0) endif else beginseq(MySequence) Component.MyButton.BackColor = RGB(0,255,0) endif
  18. AzeoTech

    button to start logging

    Actually, I was wrong. You can name the logging set log even though it is a reserve word. You would not want to create a variable or channel named "log" however. So, the docs are actually correct.
  19. AzeoTech

    button to start logging

    Do you have that if in a loop? Otherwise it will execute only once and unless you have the button pressed at that time, nothing will happen. Actually, when you want to do something based on channel value, you probably should use a channel event. Click on the FIO0 channel in the workspace under CHANNELS: and then select the event tab on the right. You can put code here that executes whenever FIO0 is read (except stream, in which case it is in blocks). There you should be able to put your exact code. Also, I just noticed: you can't call your logging set "log" because log is a reserved word for the function log() which performs the logarithm of a value. You should pick a different name.
  20. AzeoTech

    simple if

    You need to use two equal signs to do comparison: if (switch[0] == 1) a single = is assignment
  21. AzeoTech

    parallel traces in a graph

    How are you clearing the one trace? Using ClearHistory() I assume. Well if your _cal traces are just variables, they should still remain when you clear the history of the regular channels unless you have some sort of autoscaling. Perhaps you can email back and attach your document so we can tell what you have done.
  22. No, not quite. Anytime you create a group of channels with different Timing / Offset parameters, they run in a different thread. These threads are synced in time, but the averaging point (i.e. where in the second it decides to take 10 points) is pretty much determined by when the document is loaded and is not predictable. I'd bet if you quit and restarted it would land on a different time than the 0.7 point in the second. You have a couple choices: 1) Unless you have a reason not to, I would just sample all the channels at 10hz and average them all. With the UE9 you are well within the bandwidth, so the only reason why not would be if you need an instantaneous reading every second instead of the average 2) You can sync up the average with the 1 second reads using an event in one of the 1 second channels and a new averaged channel. To do this: a) create a new channel, lets say you call it datafinal. Make it just like your raw 10 hz channel, but give it a channel number in the thousands (one that doesn't really exist) and set the Timing to 0. This is the channel you will want to log instead of the raw 10 hz Turn averaging off on the 10hz channel and set the history to something small like 20. c) in the event for one of 1 second channels put: private average = mean(rawdata[0,9]) average.time[0] = mychannel.time[0] datafinal.AddValue(average) The first line calcs the average of our 10hz data (which I assumed you called rawdata). By doing [0,9] you are taking the mean of the last 10 data points. The next line simply injects the time of this channel into our average so it lines up. I'm assuming your 1 hz channel that holds this event is called mychannel. The final line takes that data and injects it into the datafinal channel. Now this channel will hold the 10 point average of 10 hz data lined up to mychannel. The average is calced every time mychannel gets a new value.
  23. Yes you can certainly stream the UE9 over Ethernet. In fact, it is slightly faster over Ethernet. As to your problem, I would first make sure you can communicate with the device at all by simply polling the device once a second instead of streaming. If you get that and the stream still doesn't work, please email your document and any error messages. Also, one thing that comes to mind: did you remember to change the D# on the channels that receive the data? This must match the D# you assigned your UE9 too. As for your logging problem, if you are looking to simply log once a second snapshots, you might want to use an export set instead and then use a sequence to trigger it. The export set would have [0] in all the expressions to log only the most recent value, then the sequence would simply start the export set once a minute: while (1) beginexport(myexport) delay(1) endwhile The big advantage of this method is that you can start and stop at will, and you can easily switch it to event driven logging, where the logging set is really designed for continuous logging.
  24. AzeoTech

    2 counters on UE9

    OK, first you probably should avoid using D# 0. D# 0 was provided mostly for people used to using the U12, but with the addition of first found in the device configuration, you should avoid it. The reason is that if you get another UE9 or U3 (and so are using 2 labjack devices on the same PC) you'll can't use D# 0 at all and so you'd have to go back through your code and change every instance. If, instead, you had used first found in device configuration with a D# of 1 say, then all you'd have to do is replace this listing with an actual ID number, and all your instances / code would update. Now, as to your question, the problem is simply that you didn't enable both counters in your ResetCounters sequence (which, by the way, is misnamed, as the code inside only enables the counters and doesn't reset them). The code you want is: device.LabJack.AddRequest(0,"LJ_ioPUT_COUNTER_ENABLE",0,1,0,0) device.LabJack.AddRequest(0,"LJ_ioPUT_COUNTER_ENABLE",1,1,0,0) device.Labjack.GoOne(0) Alternatively, if you use the device configuration instead of D#0 you can enable the counters from there without any code.
  25. AzeoTech

    graph control with edit box or button

    I'm not sure I understand your question. If you are using a button, you'd just go to the Action page, select Quick Sequence and type in the code like: Component.MyGraph.MyTrace.strYExpression = "V.Motor5" Create a different button for each possible trace, changing the code appropriately.