• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. I'd be curious if restarting the other side, the software that DAQFactory is communicating with over DDE resolves the issue. DDE is ancient technology of Windows that actually uses windows (note lower case w) to allow for interprocess communications. Because it uses windows (among other reasons), it uses "Resources" (note upper case R because I'm talking about something specifically named Resources), another somewhat ancient concern that rarely appears nowadays. Basically applications are allocated a limited amount of Resources and creating windows takes away from this. Once you run out of resources, you can no longer create new windows. Your latest debug data point tells me that you are somehow running out of resources, and that by not opening 6 extra windows it leaves just enough space for DDE to keep running. Resources are not the same as memory and have nothing to do with what video card you are using. I, truthfully, don't know what Windows calls it now as it generally never causes a problem. You may be able to track your Resource use in Task Manager by showing these columns: Handles, USER objects, or GDI Objects. I'm not actually sure which will line up, but you may see one of these steadily rising as your program runs.
  2. Certainly. A loss of power can cause all sorts of problems even outside DAQFactory. I once lost power during Windows boot and had to reinstall the OS (this was a long time ago....) These problems don't crop up often because systems typically are only writing to disk a very small percentage of operating time, but they do happen. That is why you should always have a UPS in place with a connection to the PC so that Windows can gently shut things down if there is a sustained power loss. A laptop achieves the same thing, but of course they tend not to be rugged.
  3. AzeoTech

    Missing data from CSV file.

    This almost certainly is due to the alignment parameter of the logging set and differences in the time stamp. If you are taking data once a second and generally all data at the same time, you'll want the align threshold at something like 0.7 or so.
  4. Your best bet would be to use a service such as to do this. With that product you'd have to create separate HMI screens for the web, but they will work more efficiently and across all devices. Alternatively, you could program DAQFactory to take screenshots of pages, then upload them to a webserver. Sending commands back to DAQFactory would be slightly harder, but is best implemented using a pull mechanism, meaning DAQFactory queries the server at some interval to see if there are commands to perform. You do not want to open up the system running DAQFactory to the Internet as that is just asking for security problems. Not because DAQFactory is more insecure than anything else, but because opening up the system to the Internet exposes the system to attacks on all levels, the most likely being on the OS and probably DoS type attacks (even if they are unintentional).
  5. DAQFactory uses a rolling buffer file for persist files. That means that when a data point is added to the persist file, only three 8 byte chunks are actually written to disk. 16 bytes is the new data, and 8 bytes is used as a pointer to the most recent data. While that is fine for the 16 bytes as that is always a new place on the disk, the 8 byte pointer is going to be the same place on the disk always. Newer SSD drives should wear level and this should not cause a problem, however, it does mean that if this pointer is corrupted then things go to hell. So: 1) probably some disk failure on your system. The first thing I would do if it happens again is see if the files are all still the same size as reported by the OS. 2) not really unless you want to try and read each of the headers and validate them. You could write a script to do this for sure, but is probably not worth it unless it happens again. 3) probably. If the problem is the header, you could probably rewrite it with correct data. For sure, you could write script that loads from your log files and then recreates the persist data by adding the log data back into the channel. Just remember, persist files aren't meant to be a replacement for logs. Important data should always be logged. Persist files are just for rapid, easy access to historical data. You could also not use persist and instead access historical data from logs. The easiest way to do this would be to log to a MySQL database and perform queries on the data as needed. It won't perform quite as fast, but should be more than adequate if you use db.queryToClass()
  6. AzeoTech

    Multi Color LED

    Actually, the quickest way is to display the Event panel (View->Events), select each LED, then select the OnPaint event. Let's say the variable is called myVar, and the first LED shows state 0 and 1, and the second 2 and 3. So, the On Paint event for the first LED would be: visible = myVar < 2 while the second LED would be: visible = myVar > 1
  7. AzeoTech

    Upload file

    You should use the File. functions, specifically File.Open() to open the file, File.ReadDelim() to read the file into memory, and File.Close() to then close the file after reading. Once it is in memory you can do anything with it. ReadDelim() should read the file in one step into a multidimensional array.
  8. AzeoTech

    Multi Color LED

    There are several ways. First, you could use a symbol component. Create 4 rows, one for each color. Then in Symbol Factory find an LED symbol you like, change it to the various colors, and paste each into a row. Give each row a different threshold, say 0, 1, 2 and 3. Then assign a variable to the Expression. Then when you change the value of the variable, the different symbol will be displayed. You can also do it from script by changing the background color of a symbol component, or even a panel component. But then it will be a square LED. For a more shaped LED, you need to use the method above. You also could do it using two LED components on top of each other, one that does state 1 and 2, and the other that does 3 and 4. Then in script make it so only one of the LED's are visible. If you wanted to reuse this, you could group the components and do everything through the group.
  9. That really depends on the web server. Are you going to use DAQFactory as a webserver or send data to another webserver? By far the easiest method is to use DAQConnect (
  10. AzeoTech

    License recovery

    Please contact us directly via email for licensing issues.
  11. AzeoTech

    Upload file

    Upload where? Do you mean load it into DAQFactory memory for display? Or upload it to a webserver? Or something else?
  12. Assuming you are seeing the proper voltage swing, to convert from Volts to Amps you would use a Conversion. Click on CONVERSIONS: in the Workspace, then Add a new conversion. Give it a name, like "HallEffectCurrent" or something. The Expression in your case would be: Value / 5 * 60 - 30 Of course you can reduce that if you want, but showing it unreduced makes it more obvious what was done. So Value/5 takes 0-5 and converts it to 0-1. * 60 converts it to 0-60 (amps), then the -30 converts it to -30 to +30 amps. Finally, go to your input channel and select the new Conversion and Apply.
  13. AzeoTech

    Report Creation

    Unfortunately you will almost certainly have to use the Acrobat Distiller and printPage. If you are having problems with printing the page, you might need the latest build. Please email us directly and we can provide you with a beta. It does printing a lot better than older releases.
  14. This really only applies if you are running continuously without powering off the LabJack (which resets the counter): I believe that the LabJack M counter is a 32 bit counter. So, once you reach 4.2 billion counts or so, its going to reset to 0. So every so often (like once a month) RawCounts[0] is actually going to be less than RawCounts[1]. So, you have to adjust: if (RawCounts[1] < RawCounts[0]) counts = RawCounts[0] - RawCounts[1] else counts = RawCounts[0] + 2^32 - RawCounts[1] endif Just FYI: you can do this two other ways in a single line of script, which is more efficient for the computer, but harder to understand by humans: counts = iif(RawCounts[1] < RawCounts[0], RawCounts[0] - RawCounts[1], RawCounts[0] + 2^32 - RawCounts[1]) or even better: counts = RawCounts[0] - RawCounts[1] + (2^32) * (RawCounts[0] < RawCounts[1]) The last one is probably 100 times faster than the original if/else, and maybe 20 or 30% faster than the iif(), but I''m guessing at that.
  15. You are right. I got that backwards. I was thinking about a regular delta. The folks at LabJack will need to address the DIO# issue. But the problem with using this method is that you can lose counts while the counter is being reset. This probably isn't an issue at low count rates, but at high ones, it can be significant. That said, at high rates, you also have to change the expression I gave you to account for counter roll over.
  16. Create a second channel, Device Type "Test", I/O type D to A. Call this one, say "Counts", and call your actual LabJack counter channel "RawCounts". Expand CHANNELS in the workspace, and select RawCounts. Then select the Event tab. In the event type the following: Counts = RawCounts[1] - RawCounts[0] The Counts channel will now hold the difference in counts between two consecutive readings. To get 10 second counts, set the Timing for the RawCounts channel to 10.
  17. AzeoTech

    AscA not working as expected in execute()

    Actually the problem isn't with asca(). The problem is that string concatenation doesn't support arrays. So even: ? "array: " + {1,2,3} + " end array" will print: array: 1 end array The problem is that DAQFactory doesn't really know how you want to present the array. Do you want a comma delimited list? With brackets or without? Space after the comma? Etc. Plus, beginners often really only want [0], especially when using channels, but forget to do so. So: "My Value: " + myChannel will do the same as: "My Value: " + myChannel[0] So, in your case, what you really need to do is keep the asca() in the quotes: execute(ChannelName + ".AddValue(asca(" + strArg + "))") that way the concatenation doesn't involve the array. But then, why are you pulling out strArg anyway? Remember, execute() runs in the scope of the call script, so you should be able to reference strArg from within the string: execute(ChannelName = ".AddValue(asca(strArg))")
  18. Not directly. But you'd simply have to create a global variable, set that variable, start the sequence, then use the variable inside the sequence. I suggest naming your globals something with the sequence name, for example: mySequence_variableName. There are ways to run functions in their own thread, though this is usually best done inside an object to avoid losing track of the thread.
  19. Starting and stopping the stream like that is impossible because DAQFactory only sees the data in blocks. You can log that data, however, using an export set. Just clear the history of the channel before starting the stream (myChannel.clearHistory()), then start the stream. Once you stop the stream you can log the first 125 values using the expression: myChannel[numrows(myChannel)-126, numrows(myChannel)-1] in the export set.
  20. Most no. You have the wrong hex values. You have to think in binary, and might want to use binary notation instead:: D7-D4 (Batt_Status[0]>>4) & 0b1111 and D3-D0 Batt_Status[0] & 0b1111 if I named A16 CES and I wanted the charging status (D3-D2) (CES[0]>>2) & 0b0011 if I wanted A16 D15-D14 would it be (CES[0]>>14) & 0b11
  21. AzeoTech

    Read Pressure Device

    Good. Actually I pretty much never use the user serial protocols unless I need to create a protocol that I will use across multiple documents. It is much easier to develop protocol code in a sequence. In fact, even if I expect to create a user serial protocol, I'll still develop it first in a sequence to test it, then migrate it over.
  22. AzeoTech

    windows 10 saving

    This actually has more to do with default security settings for folders in Windows 10, along with changes in how DAQFactory installs. By default, the DAQFactory installation folder (and most of its subfolders) are marked read-only to non-admins. Simply running as Admin doesn't get you past this. So, you have to go the folder you are trying to log to in Windows Explorer, and change the security on that folder to allow Everyone to write to the folder.
  23. AzeoTech

    Calculate rms value of an an array

    I don't think so. You were on the right track at the bottom, but the field labelled RMS is: max(captureddata) / 2^0.5 when it should be: mean(captureData^2) ^ 0.5
  24. AzeoTech

    Logging on a specific treshold

    #1) do you only want to log after the time the channel becomes greater than X? I.e. when it crosses the threshold? First of all, there are time latencies that can't be avoided if you do this in software. This comes from both the delays in communications with hardware, and with how often you query the input. For example, if your Timing is set to 0.1, then even ignoring comm delays, DAQFactory may not know if the channel crossed the threshold for 99.99 ms. There are a couple ways around this, as you can't query the input faster than maybe every 10 or 20 ms. Even if you stream, you can't do the logic in-situ because in stream mode, the data comes in in blocks. The first way is to stream, but stream both channels, then analyze the data in blocks as they come in. This is a bit more complicated to achieve, and is usually best done in a separate sequence. The problem with this is that you still are subject to the latencies of streaming, but you can stream really fast and get that well below a millisecond. If, however, you really need it super tight, you will have to use hardware triggering. Use a schmidt trigger to set a digital signal for when the threshold is crossed, and feed that trigger into a trigger input on your DAQ device. The LabJack supports this sort of thing, but I don't know what hardware you are using. #2) this is much easier. Create a global variable called, say, "startTime", declared in an auto-start sequence. Then at the top of the sequence you want to top, do: startTime = systime() Then, wherever you want to display the elapsed time, use something like: iif(mySequence.running, systime() - startTime, 0)
  25. AzeoTech

    Calculate rms value of an an array

    Yup, but I'm not sure how well it will work with quantized data. The accuracy is going to depend on the sampling interval, and some sort of curve fit might be helpful. But ignoring that and assuming you have a channel / array "X" with your data, the RMS calculation in DAQFactory would simply be: mean(x^2) ^ 0.5 Remember, doing x^2 returns an array the same size as x, where each value of x is squared. Mean() takes the mean of whatever array is provided to it. And ^ 0.5 raises whatever is to the left to the 1/2 power, which is the same as square root.