AzeoTech

Administrators
  • Content Count

    5,729
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Long logging time in Excel

    Yes, Access certainly would do it, but you won't be able to log directly to an Access database with DF-Express. This requires DF-Standard. You might be able to import it, but that really gets to be a pain. The idea of using 4 columns isn't bad, but would be difficult in DAQFactory. You wouldn't be able to log in-situ, and instead would have to use an Export set to write the file after the data acquisition is done. This is a bit dangerous since a power failure would mean none of the data would be logged. Once again, my recommendation is that you look for a better analysis tool than Excel.
  2. AzeoTech

    Corrupted CTL file?

    I need to see the .ctl document. If you don't want to post, go to www.azeotech.com, hit Contact Us and send it through the form. I'm also unsure where you are putting the comments.
  3. AzeoTech

    Long logging time in Excel

    First, might I recommend using a better analysis tool? My personal favorite is Igor, but its quite expensive. There are lots of others that are quite inexpensive and much better at analysis than Excel. That said, yes, this is quite easy. Lets assume you have an input channel called MyInput, and a logging set called MyLog. 1) Click on "MyInput" in the workspace under CHANNELS to display the channel view, then click on the event tab. 2) In the event tab put: logging.mylog.strFileName = "c:\data\mydatafile_" + formatdatetime("%p",systime()) + ".csv" 3) Click apply. What this will do is set the file name of your logging set every time a new data point comes in. 99% of the time, it won't change it at all, but when noon and midnight roll around, it will change the file name. The formatdatetime() function with %p simply generates AM or PM, which is tacked to your file name. The problem with this is if you don't start the experiment at exactly midnight. For this reason you might want to instead put: logging.mylog.strFileName = "c:\data\mydatafile_" + formatdatetime("%y%m%d%p",systime()) + ".csv" which will add the date to the file name as well, thus creating a new file every 12 hours at noon and midnight. Without that, if you ran from say 3am to 3am, the data from midnight to 3am will end up at the end of the file that had data from 3am to noon, with the data from noon to midnight in a separate file.
  4. AzeoTech

    Error message D0050?

    Yes, my apologizes. The "D0050..." part of the error message is generated by DAQFactory. With the next release, there will be even more info in this part to make error handling easier. The "Pin not configured" is from the LabJack UD and thus generated by the LabJack itself.
  5. AzeoTech

    DISTORTION OF SIGNAL IN DAQ

    First: the wireless is not what is causing the distortion. At this point your signal is all digital and any noise on the line would cause you to get no signal, not noisy signal. Its like cell phones. Before digital, you'd get weird noises when the signal was bad. Now you just get drop out. Most likely the problem is in the signal itself, usually due to faulty wiring, bad grounds, or just plain noisy signal. The LabJack user's manual has some suggestions on quieting signals. If you want to quiet your signal in DAQFactory, you can simply average the signal. In the channel table, check the box that says Avg? and in the # Avg column put the number of data points you want to average. Please use this with caution. Software noise reduction is good, but only if you fully understand the causes of your noise. My personal favorite example is the story of the ozone hole. Scientists had been measuring the ozone levels in the Antarctic for years before the hole was discovered. Unfortunately for those scientists, they had set up their computer to eliminate any data below 50 as noise and glitches since they didn't believe it would be possible to have a value below 50ppb. Alas, when another group published results showing the ozone hole, they were kicking themselves because they would have discovered it first if they hadn't over-massaged their data.
  6. AzeoTech

    Error message D0050?

    This is a U3 only error. Not sure where it is in the LabJack manual. The settings are not stored in flash, but I believe there is a way to store the current settings as the defaults. The LabJack folks will have to address that, and will hopefully add a reply tomorrow. As for the DF update, yes you can download the Express update from www.daqexpress.com. The update is not the full installer, so you have to have Express installed on the PC before downloading from this update. There is no way to download the full Express installer from the web. This you must get from the CD that came with the LabJack.
  7. AzeoTech

    Error message D0050?

    Most D0050 errors are errors coming from the low level LabJack driver and so are presumably documented in the LabJack user's guide and not in the DF guide. Because the folks at LabJack improve their devices faster than we can keep up, we have designed things to be generic so you don't have to update DF every time the LabJack changes. That said: the error you see is because you are trying to read the pin as an analog input when its configured as a digital, or visa-versa. The latest release of DF will auto-configure your pins as much as possible, but even then, certain things can cause this error. The most common, while running, would be if you do the config yourself in an Auto-start sequence, and then the device gets unplugged, or resets itself. A PinConfigurationReset will also do it. My recommendation is to create a simple sequence that configures all the pins exactly how you want it which you can run whenever this error occurs. If you want it to auto configure, then wait a few days for the 5.75 release (hopefully by tomorrow 12/17/07, but it may be tuesday) and use the OnAlert function now available and call your pin configuration routine whenever that error occurs. There will be a new guide in the new release that shows how to do this sort of thing.
  8. AzeoTech

    DAQFactory cannot find LabJack.dll

    Go to www.daqexpress.com for an update for DAQFactory Express. For regular DAQFactory, go to www.azeotech.com and install the newer trial over your existing.
  9. AzeoTech

    DAQFactory cannot find LabJack.dll

    My guess is that when you created your output channels you accidentally selected the LabJack_U12 device instead of the LabJack device. The LabJack.dll file is for the U12 only. DAQFactory can't load it because you probably don't have the low-level U12 drivers installed. Why would you when you are using a U3? The DF driver for the U3 (and UE9) is LabJackN.dll. Anyhow, go to your channel table and select the "LabJack" device instead of "LabJack_U12" I should add that the error message has been updated in newer releases of DAQFactory to be a bit clearer. In general, though not in your case, if you see an unable to load device driver error than you most likely forgot to install the drivers from LabJack, available from there downloads page. These drivers are pretty much required no matter what software you use. It may be a little confusing as DAQFactory has a LabJack driver DLL, but it in turn communicates with the LabJack driver from LabJack. So really you need two drivers, the one that comes with DAQFactory (LabJackN for U3 / UE9, and LabJack.dll for U12), and the one from LabJack.com (labjackUD.dll for U3/UE9, and LJackUW.dll for U12). Both are included on the CD as long as you run both the LabJack and DAQFactory installers.
  10. DAQFactory uses @ instead of & to reference a variable. D# is essentially the same thing as the handle. You pass a reference to a variable to that function and if it succeeds (returns LJE_NOERROR), then that variable will hold a number. That number should be used wherever D# is required for all the other LJ functions (typically the first parameter). We will be posting an update of DAQFactory Express (5.75) along with a 80 page or so getting started with DAQFactory and LabJack guide this weekend. This guide goes over all of this stuff in reasonable detail and I think will help you a lot. Visit www.daqexpress.com and check for the update on Monday. The getting started guide will be in the download. If you update you MUST also update the LabJack Universal Driver to the latest 2.77 release which LabJack should release this week.
  11. AzeoTech

    Settint Alarms

    Well, technically, that's not so really an alarm, but conditional logging. I mention it only because there is something else in DAQFactory called alarms, which technically could be used for this, but is overkill. I'm going to assume you have a channel called RPM and a logging set called MyLoggingSet. 1) Click on the RPM channel in the workspace (under CHANNELS:), then click on the event tab. 2) In the event tab put the following script: if ((RPM[0] > 1000) && (RPM[1] < 1000)) beginlogging(MyLoggingSet) endif if ((RPM[0] < 1000) && (RPM[1] > 1000)) endlogging(MyLoggingSet) endif You could also write it this way: if (RPM[0] > 1000) beginlogging(MyLoggingSet) else endlogging(MyLoggingSet) endif I'm actually not sure which would be more efficient. Probably the second one. Now the only problem is that logging sets are not really designed to be started and stopped a lot and have a small amount of latency. This means that you may miss the first few data points after the RPM passes 1000, or you may get a few extra after it drops below. If this is a problem, you should probably use an export set instead, with the export set setup to only log one line of data. My guess is that you are not constantly going above and below 1000 rpm so this is probably not a big problem.
  12. AzeoTech

    Reading data from file does not work after update?

    Oops, there is a period (or the word string) missing in this line: Private strIn = File.Read(hFile) It should be either: Private.strIn = File.Read(hFile) or Private string strIn = File.Read(hFile) The second way is the more modern way, but the first works just as well. The clue is that the error says that its looking for number where a string was found. Since "" is obviously a string, the compiler must think the other thing, "strIn", is a number, which we know is wrong, so we look at the declaration and see that it is not declared as a string.
  13. Yes and no. We'll add a direct way with release 6, but for now you can use the generic component events (under 5.7+). Go View-Event to display that docking window, then select the component, then select an event. You'll probably need to use OnPaint since most of the others are handled by the control. Its certainly not as clean as it should (and will be under 6.0), but at least the script stays with the component. If its common functionality, you can even create a user component for it.
  14. AzeoTech

    Reading data from file does not work after update?

    I'm not exactly sure why its happening, but doing private.x.time = parse(..) is messing up your values. Presumably, instead of putting it in the time portion, its putting it in the main portion. The solution is actually the preferred way of writing this code anyway. In your script, you are parsing the string for time 6 times, one for each value, even though the time is the same. Instead you should parse once at the beginning: Private.hFile = File.Open("c:\Documents and Settings\Darren1\My Documents\vegoil\Logs\Labjack Logs\glowplug\special\GP-cold-drive.csv",1,0,0,1) V.Cyl4GP.ClearHistory() V.Coolant_Temp.ClearHistory() V.Cyl4IQ.ClearHistory() V.DF_Mark.ClearHistory() V.IQ.ClearHistory() V.rpm.ClearHistory() V.VAG_Mark.ClearHistory() Private.strIn = File.Read(Private.hFile) while (1) Private.strIn = File.Read(Private.hFile) if (Private.strIn == "") break endif Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) Private.x = StrToDouble(Parse(Private.strIn,1,",")) V.Cyl4GP.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,2,",")) V.DF_Mark.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,3,",")) V.VAG_Mark.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,4,",")) V.rpm.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,5,",")) V.IQ.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,6,",")) V.Coolant_Temp.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,7,",")) V.Cyl4IQ.AddValue(Private.x) endwhile File.Close(Private.hFile) Also note that you had a comma in File.Close() Finally, you should probably move away from using private. notation. It makes the script less readable and why we allow you to declare variables now: Private hFile = File.Open("c:\Documents and Settings\Darren1\My Documents\vegoil\Logs\Labjack Logs\glowplug\special\GP-cold-drive.csv",1,0,0,1) V.Cyl4GP.ClearHistory() V.Coolant_Temp.ClearHistory() V.Cyl4IQ.ClearHistory() V.DF_Mark.ClearHistory() V.IQ.ClearHistory() V.rpm.ClearHistory() V.VAG_Mark.ClearHistory() private x Private strIn = File.Read(hFile) while (1) strIn = File.Read(hFile) if (strIn == "") break endif x.Time = StrToDouble(Parse(strIn,0,",")) x = StrToDouble(Parse(strIn,1,",")) V.Cyl4GP.AddValue(Private.x) x = StrToDouble(Parse(strIn,2,",")) V.DF_Mark.AddValue(Private.x) x = StrToDouble(Parse(strIn,3,",")) V.VAG_Mark.AddValue(Private.x) x = StrToDouble(Parse(strIn,4,",")) V.rpm.AddValue(Private.x) x = StrToDouble(Parse(strIn,5,",")) V.IQ.AddValue(Private.x) x = StrToDouble(Parse(strIn,6,",")) V.Coolant_Temp.AddValue(Private.x) x = StrToDouble(Parse(strIn,7,",")) V.Cyl4IQ.AddValue(x) endwhile File.Close(hFile)
  15. AzeoTech

    DAC that adjust itself

    Well, really the best way to do this is with a PID loop. For that you will need DF-Base or higher. You could try and do it with some basic logic in Express but it won't work as well. What you would do is go to the event for either RPM or MPH and then using your formula and some other logic, set the output channel. So if you just wanted to set the output to 5*U/V you'd do: MyDACOut = 5 * (RPM[0]*0.2803030303)/MPH[0] where MyDACOut is your output channel. More complex logic would be done the same way.
  16. AzeoTech

    UE9 Quadrature Counter Configuration

    Actually, you are pretty much there if you have the timers setup. Just to clarify, to setup the timers for quad, you just have to enable the two timers with LJ_chNUMBER_TIMERS_ENABLED and then tell both timers to be LJ_tmQUAD. As EISServices correctly did, it takes two timers to read one quadrature input. The easiest way to read the timer once this is done is to create a channel with I/O type Timer, channel # = 0 in this case (the first timer of the pair), Timing = the desired update interval.
  17. AzeoTech

    Objet color changing

    As long as you only use those buttons to start / stop the sequence, the easiest way to do this is to change the colors as part of the action of the buttons. So: 1) Name both your buttons. Select each, right click and select Component Name... I'll assume you called them StartButton and StopButton. 2) In the StartButton, go to the Action page where you probably have begin/end sequence. Select "Quick Sequence" then in the script put: beginseq(myseq) component.startbutton.backcolor = rgb(128,128,128) // grey component.stopbutton.backcolor = rgb(255,0,0) // red 3) In the stopbutton, do the same thing essentially, but the script becomes: endseq(myseq) component.startbutton.backcolor = rgb(0,255,0) // green component.stopbutton.backcolor = rgb(128,128,128) // grey You can tweak the three numbers to get any color you want.
  18. AzeoTech

    Reading data from file does not work after update?

    Can you post a sample: ie. the .ctl document and a sample text file, so we can see it in action. Then we can also show you exactly how to do it with readdelim() which is certainly easier.
  19. I'm a bit lost as to what you want. The counter sample was just that, a sample, that you should be able to extrapolate out your needs from. The concepts for performing something with every channel value, calculating a value relative to another value on the same channel, and storing a calculation in another channel are all there. I think you just need some if statements to handle the pipe changes. If you want to determine delta-T as well, just use: mychannel.time[0] - mychannel.time[1] This is in seconds.
  20. AzeoTech

    labjack UE9

    I'm unsure what direction you got to. Can you please attach your .ctl document so I can determine this? Also there are samples, including ones for streaming at www.daqexpress.com to make it easy for you.
  21. No actually, you can't use [] notation on "Value". That would require DAQFactory to keep a history of unconverted values as well as converted values which would be a huge memory hog. I didn't realize you wanted to do math on two readings from the same channel. The process follows how you should deal with counters when trying to determine number of pulses per second. In this case you do not want to reset the LabJack counter, but instead let DAQFactory calculate the difference between consecutive readings. This is because resetting the counter can result in missed counts. Here are the directions for doing that, which are pulled from a soon to be released complete LabJack / DAQFactory user's guide, and hopefully you can adapt it to your application. I included the whole section just in case: 1) Create a channel to read the counter. Call it RawCounts or similar. This will be Device Type LabJack of course, D# = LabJack ID, I/O type of Counter, Channel # = desired counter or 0 on devices with only one counter. Set the Timing to whatever your desired interval is. For counts per second, put 1.00. 2) Create a second channel that will hold your counts per interval. Call it Counts for now. This channel will be Device Type Test, D# = 0, I/O Type = A to D, Channel # = 0, and most importantly, Timing = 0. Click apply to save your new channels. 3) Click on the + next the CHANNELS: in the workspace, then click on the RawCounts channel. When the channel view appears, click on the Event tab. Enter the following script: Counts.AddValue(RawCounts[0] - RawCounts[1]) 4) Click Apply. At this point, provided RawCounts is actually getting increasing counts, the Counts channel will have the interval counts. You can click on the Table tab to see this. The problem with the above method is that it doesn't account for counter roll over. On a 32 bit counter this happens at just over 4 billion counts, so before worrying about this, you might want to figure out how long it would take to accumulate that many counts and see if its worth worrying about. Remember that if you reset the counter at startup, you only have to worry about the amount of time DAQFactory is continuously running. If rollover does occur, all you will see is a negative interval counts measurement. You can post-calc the correct measurement by simply adding 4294967296 to this negative number. That is 2 raised to the 32 power. But, if you don't want negative counts on rollover, you just have to change the Event from step 3 slightly: if (RawCounts[0] > RawCounts[1]) Counts.AddValue(RawCounts[0] - RawCounts[1]) else Counts.AddValue(RawCounts[0] - RawCounts[1] + 2^32) endif Of course if you have a 16 bit counter, you'll need to change the 32 to 16 so it adds 65536 instead. Hertz measurements: Finally, if instead of actual counts in an interval, you want a hertz measurement (counts per second), we just change the AddValue() lines to divide by the difference in time: if (RawCounts[0] > RawCounts[1]) Counts.AddValue((RawCounts[0] - RawCounts[1]) / (RawCounts.Time[0] - RawCounts.Time[1])) else Counts.AddValue((RawCounts[0] - RawCounts[1] + 2^32) / (RawCounts.Time[0] - RawCounts.Time[1])) endif The nice part about this is that if DAQFactory gets delayed a few milliseconds before doing the read, the hertz measurement will be properly normalized.
  22. Why wouldn't you just use a channel, set the Timing to 60, and then use a Conversion to scale the value?
  23. AzeoTech

    Moving decimal places FormatString

    Sorry, its syntactical.
  24. AzeoTech

    Moving decimal places FormatString

    if (strtodouble(datain) != NaN()) &= NaN()) I don't know what the extra &= Nan() is for and depending on your release of DAQFactory, the parser is probably ignoring it. It does not make syntaxical sense, so eliminate it. If all you want is the data when the first four characters are 0110, you should change that line to: if (left(datain,4) == "0110") As for your infinite loop, you for some reason have that turned on. Just go to File - Preferences and turn it off. It defaults to off in new releases as it usually just gets in the way (as it is in your case). You do want ReadUntil(10) because the \010 marks the end of a line and the rest of the code expects a full line. Considering how fast your loops are running, you should check your timeout on your serial port and make sure its set to 100 or more. Anything shorter is kind of pointless and will cause this loop to run too fast and chew up all your CPU power. Vertical graphs: you can actually do this. Just treat the graph as an XY graph and put time on the Y axis. You can't put "Time" as the Y expression though, but instead need to get the time of the channel manually. So if you are normally plotting MyChannel vs Time, you'd instead plot MyChannel.Time vs MyChannel. Note that the axis label won't be in units of time, which is the only problem with this method. However, you can disable the Y axis labeling and add your own manually. As for moving and rotating symbols, you can definitely already do that, and have been able to since the beginning of DAQFactory. To move any component, use the component's MoveBy() and MoveTo() functions. You'll need to name the component first. To rotate, you can specify a non-zero Rotation on the image to rotate the image as is with each screen refresh, or use multiple images in an animation to make it look like its rotating, which is good for off-axis rotation.
  25. AzeoTech

    Moving decimal places FormatString

    You forgot the "try": while (1) try datain = device.serout.ReadUntil(10) if (strtodouble(datain) != NaN()) data = strtodouble(mid(datain,4,10)) endif catch() delay(0.1) endcatch endwhile The indenting is the give-away and thus the reason good indenting pays off. You had a six space indent from while(1) to the next line. That should fix your problem, so you don't want the readuntil(999999). 6.0 will come out probably the middle of next year. Why do you ask? Are there features you'd like to see? There will not be an upgrade charge. There is no screen scrolling at this point. This is one feature that will definitely be in 6.0. The scroll bar component doesn't have "Vertical" because it automatically determines the direction based on the shape of its box. Just resize it so its taller than wide and it will display vertical. The scroll bar component does not actually scroll anything. You have to program it to scroll something.