• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    add page

    If you wish additional pages, you can purchase DAQFactory Lite for $199 from This will give you unlimited pages, 30 or so more screen components (like guages, sliders, knobs, etc) and support for devices other than LabJack. Your Express document will work without change in Lite or any other version of DAQFactory, so the upgrade is very easy.
  2. AzeoTech

    U12 stop logging at a defined time

    No problem. Assuming your logset is called MyLogSet: beginlogging(mylogset) wait(900) endlogging(mylogset) This simply starts the logging when the sequence starts, then the sequences waits 900 seconds (15 minutes), and then it stops the logging set. Then just create a button to start this sequence. Note that stopping this sequence early won't stop the logging set, so if you want to be able to manually stop early, use the Quick Sequence action of the button instead of Start/Stop sequence and put something like this (assuming the above sequence is named MySeq: if (Sequence.MySeq.Running) endseq(MySeq) endlogging(mylogset) else beginseq(MySeq) endif Basically it looks to see if the sequence is running and if it is, it stops both the sequence and the logging set, otherwise it simply starts the sequence.
  3. Sure, just use a variable. Declare it somewhere (say auto-start sequence:) global timecounter Then when you want the time to start do: timecounter = systime() and wherever it is displayed, put: SysTime() - timecounter Use formattime() to display in H:m:s: formattime(systime()- timecounter) or formatdatetime() if you want more control over the display. If you want an accumulating counter, you'll need two variables: global timecounter = 0 global totaltime = 0 to start counting do: timecounter = systime() to display do: formatdatetime("%H:%M:%S", (systime()-timecounter) * (timecounter != 0) + totaltime) This uses a little boolean math to only include the running time (timecounter) part when the counter is counting. to stop counting do: totaltime += systime() - timecounter timecounter = 0 to reset do (when timer is stopped): totaltime = 0
  4. Well, as I said, you have to put V. in front of all your V channels. To clear the history, just do V.MyChannel.ClearHistory(). That all said, I'd use test channels instead. Just create regular channels with device type test, I/O type A/D and a Timing of 0. Then you can do: MyChannel.AddValue(Eingang0[0]) The advantage of this is that you can utilize all the other channel features such as logging, averaging, broadcasting (if using >= DF-Standard), and the persist files.
  5. Well, first I'd have to ask why you are using V channels? They are a bit old school and most of their features have been replaced by better solutions. But as to why your code doesn't work, you have to put V. in front of V channels because technically the channels are on the V connection. Also, note that you won't really easily be able to log these channels. You'd pretty much have to use an export set. Also, be careful about this: V.Virtual1 = Eingang0 By not subsetting Eingang0 you are technically trying to add the entire history of Eingang0 to the v channel. I believe in this mode, with =, it will actually only put the latest value, but its much better to be specific as to what you want: V.Virtual1 = Eingang0[0]
  6. AzeoTech

    Streaming counter

    Yup, sorry about that. I forgot to mention that detail. DAQFactory doesn't know that you are streaming a counter. The driver is designed to be open so that when LabJack releases new hardware and new features, it will work immediately with DAQFactory. So, all the stream data comes in on the A to D I/O type because as far as DF is concerned, its all analog input...
  7. AzeoTech

    Flowmeter - pulse or voltage?

    Whenever you have a choice between a device that outputs pulses and the same device that outputs volts for the same measurement you should choose the pulses. This is of course provided you are using one of the LabJack devices (any type), have an available counter or timer, and the frequency of the pulses is less than the max freq of the counter or timer. The reason is that pulses are digital signals and volts are analog. Like everything else that toutes digital over analog, the reason is that digital signals are less subject to noise. All your device with a voltage output is doing is counting the pulses coming out of the paddle wheel and generating a proportional voltage. Its called a frequency to voltage converter for the simple reason that that's what it does. So, you have a pulse, which is then converted to an analog voltage which you feed into an analog input on a LabJack which converts it to a digital signal. If you use the pulses directly with a counter, you simply have a pulse which the LabJack converts into a digital signal. Notice how "analog" isn't in this method. Exception to this rule: If the distance between your sensor and your LabJack is long and you are in a noisy environment, then there is the possibility of getting a noise spike that looks like a pulse. You can easily check for this by simply stopping the process and making sure the counts remain at 0. If they don't, there are two solutions: 1) move the LabJack closer, either by using a UE9 that supports ethernet, or extending your USB using hubs. Note that you cannot run a USB cable more than 6 feet without a hub. Yes they sell USB cables that are longer than 6 feet, but the spec says 6 feet max and if you want reliability you'll follow the spec. 2) you could use a freq-voltage converter and then a voltage to current converter to get a 4-20mA signal and run that to the Labjack, then put a resistor to convert the current back to voltage and read it with an analog input. Current signals are not subject to noise, thus the reason 4-20mA signals are used in industrial environments. Of course this method requires extra hardware, and will generate noise of its own because of all the conversions so its a bit of a toss up. Which is better really depends on environment. As for how to do it with DAQFactory and U3, go to and you'll find samples that include reading the U3 counter.
  8. AzeoTech

    Streaming counter

    In DAQFactory, instead of multiplying MSW by 2^16 you can just left shift by 16: (MSW << 16) + LSW The parenthesis are required because << is a lower priority operator than +
  9. AzeoTech

    error C1070

    First, go to and download the latest version of DAQExpress. It allows unlimited sequencing. As for your V Channel issue, you have to use V.Chan = newvalue not the AddValue() function.
  10. AzeoTech

    error C1070

    This is because you used a single = sign in your comparison. It must be ==. We may change this in the future as it catches a number of people, but for now you must use == whenever comparing values, and a = when assigning a value. Next a few comments on your sequences: 1) Don't use Time / Goto notation. Its bad form and is only there for backward compatability. Use: while (1) digitalout = 0 delay(30) digitalout = 1 delay(30) endwhile 2) If you really want the setting of the digitals and the readings to sync up, put them in the same sequence: while (1) digitalout = 0 read(Eingang0) Motor1.AddValue(Eingang0[0]) delay(30) digitalout = 1 delay(30) endwhile 3) if you are concerned about propogating time errors (i.e. loop taking slightly longer than 1 minute, use wait() instead of delay(). For those reading this and doing short loops, you have to be careful using wait(), but for your app, where the delays are long, a wait() should be fine.
  11. AzeoTech

    Streaming counter

    Actually you didn't mention that you were using a UE9 originally, thus your original problem. The UE9 / U3 use a different driver then the U12 so anything that applies to the U12, such as Glenn's document and the U12 samples on the CD will not work for the UE9 or U3. For these, you should use the UE9 samples as you did. As for how to stream the counter / digital in's, I leave it to the Labjack guys to tell you the exact commands for this. The DAQFactory UE9/U3 driver pretty much exposes the UD as is, so the functions you would do as documented in the UE9 manual are the ones you would use in DAQFactory, except that you would put quotes around the constant names. You can see this in the stream sample for the UE9, which would make a good starting point. You should only need to specify different channel numbers. The other different between the DAQFactory UE9 / U3 driver and the LabJack UD is that DAQFactory automatically takes care of reading the stream data and putting it in the appropriate channels. Again, the stream sample shows this. You can find the latest samples and the latest release of DAQFactory Express at
  12. AzeoTech

    Streaming counter

    What other samples are working? The ones that run in DAQFactory or the others? When you get Unable To Load LabJack.dll, this means one of two things: 1) You don't have the file LabJack.dll in your DAQFactory directory, or its corrupt (doubtful) 2) You don't have the file ljackuw.dll in your system32 directory, or its the wrong version, or its corrupt (doubtful) For readers using U3 / UE9, you can get a similar error: unable to load labjackn.dll. This happens for the same reasons but different files: 1) labjackn.dll in DAQFactory directory 2) labjackud.dll in system32 directory
  13. AzeoTech

    Auto-increment logging filename

    Probably the easiest way is with the registry. Lets assume you have some script to start the logging set: beginlogging(mylog) In front of that script put: private lognum = registry.lognum lognum++ registry.lognum = lognum logging.mylog.strFileName = "c:\mydata\data_"+doubletostr(lognum)+".dat" beginlogging(mylog) You could technically do this all with just the registry variable I suppose... Note that registry.lognum will default to 0 until you set it to something else. Note that you can actually change the logging file name without stopping the logging set. The logging set will simply close the current file and open the new file name.
  14. AzeoTech

    Streaming counter

    With the U12, once streaming is running, you can't do anything else. So, more than likely, all you need to do is stopstream before you set your digital channel. Also, as a side point, you should put [0] inside your if: if (IO0[0] == 0) Truthfully, it doesn't really change the result, but without it, you end up comparing the entire history of IO0 to 0 and then truncating to one value, which obviously takes longer than just comparing the most recent value, which is what you want anyway.
  15. AzeoTech

    Sequences - Timer Reset

    OK, well, first you have to put all labjack constants (i.e. non-numbers) in quotes. This is probably the main difference between the way functions look in C / VB (in the U3 manual) and in DAQFactory. This is because DAQFactory can't include the C header file so doesn't know what LJ_ioPUT_TIMER_VALUE is, though you could create a constant in script... Once I changed that, and put quotes around LJ_ioPUT_TIMER_VALUE, it worked just fine. So, perhaps: 1) You don't have the latest version of DAQFactory or the LabJack driver. Although this hasn't changed much in a while, you probably should make sure you are running 5.38. Go to for the latest. 2) You don't have the most recent Labjack driver from Labjack. Go to for this. 3) You don't have the latest firmware for your U3. Again, go to for this. 4) You are using the wrong pins. You have both counters enabled, and truthfully, I always forget whether the counters come before or after the timers, and I believe they come after. Anyhow, AzeoTech is a software company and we don't have any encoders to test with, but I was able to get counts by simply alternating a wire between gnd and Vs on pins FIO0 and FIO1. Then I was able to click your button that runs the ZeroTimer sequence and the timer got reset to 0. That is, of course, after I put the constant in quotes like you have commented out.
  16. AzeoTech

    Streaming counter

    1) When I StartStream How can I: a) Zero the counter Create a new counter channel, same information as the one you want to clear, but a timing of 0, then in the Quick Note section, select "Reset? Yes". Actually, you come to think of it, you can just select Reset? Yes in your existing counter since you are never reading it. Then when you want to reset the counter, just read the channel. From sequence script you'd just do: read(mycounter) Clear the graph Clear the history of the two channels. In script its just: MyChannel.ClearHistory() So to do all this and stream, you'd create a quick sequence action on your button that looks like this: read(mycounter) // reset the counter mycounter.ClearHistory() Myotherchannel.ClearHistory() read(startstream) Sorry, I don't have the doc in front of me so don't know your exact channel names... 2) After a time the graph starts erasing on the left hand side. Why? Your history length is too short. The history is one of the parameters of the channel. It defaults to 3600 points. Make it 36,000 or more. Remember to do it on both the X and Y axis channels. The history is the number of data points kept in memory for graphing. Rather than use some preset default, DAQFactory lets you decide which channels are important and should have long histories and which are not. 3) How can I StopStream at a particular counter value (length)? You can't really stop it at the exact moment a counter hits a particular amount. You'd need a U3 or UE9 to do that, and truthfully, you'd have to ask the LabJack guys if its even possible with those devices. The problem is that the counter readings are being fed to DAQFactory in blocks, so DAQFactory can only do a comparison when a new block arrives. That said, if a few milliseconds of extra data is ok, just go to the event on your counter channel and put something like this: if (MyCounter[0] > EndLength) read(stopstream) endif EndLength is a variable declared and defined elsewhere. StopStream is your channel for stopping the stream. The event code gets called every time a new block of data is received. I believe with the U12 this is every 64 points, but that's just off the top of my head For U3 and UE9 users: the general logic for doing the above items is the same, but resetting counters and starting and stopping streaming is done differently. Just replace all the read() commands with the appropriate functions, which you can pull out of the samples at
  17. AzeoTech

    Sequences - Timer Reset

    I don't get any errors with the code you specified. Perhaps you should attach your document. Maybe you are doing something else that is having an adverse affect.
  18. AzeoTech

    Sequences - Timer Reset

    Can you please post what you've tried that is giving you "unknown error"?
  19. AzeoTech

    Streaming counter

    As I expected it was something simply. You have to actually select "Yes" from the list. It appears you typed it in or something and put a lower case "y" instead of "Y". This driver is a bit older and was written back in the days when DAQFactory was case sensitive. Give that a try and it should work for you.
  20. AzeoTech

    Streaming counter

    OK, to start, can you attach your current document so we can see how you have it setup? Do you not see the counter change, or do you not see any new data in the counter channel? Also, make sure you have the timing set to 0. The counter channel must be type LabJack_U12, D# matches your other labjack channels (0 for first found, or the ID of the U12), I/O Type is Counter, Channel # is 0. If you see data streaming in, but its staying at 0 then you probably have a hardware issue.
  21. AzeoTech

    U3 buzzer from DAQFactory Express?

    The DAQFactory U3 / UE9 driver pretty much just exposes the LabJack UD, so you can call their functions almost verbatum. You just have to put quotes around the codes. So to sound the buzzer as it shows in the U3 manual you would put, in sequence script: Device.LabJack.eGet(1, "LJ_ioBUZZER",0,70,4000) Change the 1 to the assigned D# of your labjack, or use 0 for first found. The other parameters match that described in the LJ manual.
  22. AzeoTech

    Area under peaks

    Yes, most certainly. How depends on whether you need it to find the peak too and whether you want a baseline. Let's assume you know where the peak is and simply want to take the area without a baseline. If you know the start and end point (or time), and have it in variables, you can simply sum: sum(MyChannel[starttime,endtime])) and then multiply that times dt: sum(MyChannel[starttime,endtime])) * (endtime - starttime) This assumes that you are taking even intervals. For more advanced integration, please see the following topic in this forum: Doing baseline and peak finding is a bit more of a challenge and is a bit beyond the level of this forum as its actually a difficult algorithm that often is different depending on the type of signal. If you are interested in this, email us directly at support at
  23. AzeoTech

    Selecting a day from log file

    Not directly using a log file. It would be difficult for DAQFactory to do because there are so many options for how data can be stored. Fortunately there is an easy alternative. Starting with 5.30 (which you can upgrade at there is something called channel persistance. This is basically a binary file, one for each channel, that extends the history onto the harddrive. You can make these as big as your harddrive can handle (16 bytes per data point). Then you simply subset to retrieve the data. So, if you wanted the mean of MyChannel between 8am and 2pm you'd do: Mean(MyChannel[8h,14h]) I recommend reading up on subsetting in the help to see all the ways to subset, both by data point and by time.
  24. AzeoTech

    Loging an readable Timeformat

    Well, "stupid" is a bad choice of words I think. Its actually more difficult for most programs to deal with readable format then it is to use the numeric format DAQFactory logs with (either excel or windows format). You just need to understand what the number means and what format your application uses. This is especially true when you consider that DAQFactory is used around the world and what is considered readable to one may be backwards to another. For example, in the US its month day year, while many other places it is day month year. Unless the day is > 12, its impossible to tell which format is being used. Human readable times are also very difficult for a computer to query. So, most likely, even if you only see a human readable time in your application, the time is actually being represented as a number internally. That all said: 1) Create a new channel. Call it something like "TheTime". Device Type "Test", I/O type "String", Timing = 0. Channel # and D# don't matter. 2) In one of your UE9 channels, go to the Event and put the following line (assuming the channel you choose is named "MyChannel"): theTime.AddValue(FormatDateTime("%c",MyChannel.Time[0])) 3) Now add TheTime to your logging set. Make sure the delimiter you use in your logging set (default comma) is not used in the date / time format of your locale (which is what FormatDateTime("%c"...) will generate). If you want to log a different date format, check out the FormatDateTime() function in the help file for a list of other codes you can use to specify exactly how you want the time to look.
  25. AzeoTech

    DAQFactory stability problems

    There are a number of ways you could create a document that eats memory. For example, if your histories were very large. Histories are preallocated, but depending on how you access them, you could be duplicating large chunks of memory. I'd need to see your .ctl file to make sure you haven't done anything unusual. I'll also be able to then address why 5.32 won't run your document. There are some changes in 5.3+ that will cause some documents not to work without minor modifications. Please reply and attach your .ctl doc, or email with your doc if you don't want it to be publically available.