AzeoTech

Administrators
  • Content Count

    5,664
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Printing from DAQFactory

    This was a bug that was fixed in 5.30. You can download 5.30 of express at www.daqexpress.com.
  2. AzeoTech

    Streaming and Counters

    It only applies to streaming mode and its because of the way the Labjack UD works. It treats all streaming as an analog channel, but uses magic numbers to select other channels. So, 210 does the counter, 193 does the digitals, etc. Although DAQFactory puts the data in the right place for you, it does not know that 210 is counter, or 193 digitals because the LabJack guys may change this or add new ones, so by not fixing it in our code, we are always up to date. This is also why 193 is only one channel. DAQFactory doesn't know you are looking at 16 digitals packed into a word. When you are not streaming and simply reading the counter (or the digitals for that matter), you should use the appropriate I/O type and not A to D.
  3. AzeoTech

    Finding when data is present

    The function you want is actually GetHistoryCount() and it is a function of the channel. Event code runs in the global namespace, so you still have to put the channel name in front. So you want: if (Counter0.GetHistoryCount() < Var.DeltaT) Better way? Not really, but I'm not sure why you are using variables, since you define them just before. Yes its good practice not to put magic numbers in your code, but you should use privates instead of globals then, or declare the globals outside the event. You are reexecuting the code that does nothing the way it is written. Using ignore("all") instead of the if would work as well and actually would probably execute faster because the code will be shorter, but then you won't get 0 in RPM0 when you haven't collected enough. As for ignore(), the all needs to be in quotes: ignore("all") otherwise it is looking for a string channel named all.
  4. AzeoTech

    Streaming and Counters

    Depends on how you have the logging set setup. If you have it set as All Data Points (aligned), then it depends on your data rate and the alignment threshold. When streaming we recommend setting the alignment threshold to 0. If you don't, the maximum log rate is pretty much determined by the alignment threshold itself, with extra data thrown out. Is RPM a virtual channel or a test channel? Virtual channels can be hard to log unless you are using an export set. When thing to note about channel events is that they aren't triggered on every data point when you are streaming, but rather on every packet. The packet size will vary on the total number of streaming channels. I'd have to look up the exact calc, but I believe its 16/number of streaming inputs, but if its not divisible (i.e. you are streaming 3 or 5 channels), the packet size will vary with each packet. The reason we do it on each packet is that the scripting isn't fast enough to process it on every data point when stream rates are high. For that matter, I'm not sure an event can keep up above maybe 5ksamples. Instead you should process the data after the fact. Yes this is correct, you should get 1000 rows a second. I'd have to see your document to see why, but most likely its the alignment threshold. What you see is expected. When streaming set the align threshold to 0. Align threshold is for things like the U12 where if you read 8 analog inputs, you get them in blocks of 4 separated by about 20ms. DAQFactory assigns the exact time to both blocks, so without the align threshold, you'd get two different rows in your logging set. When streaming, all data has the same time, so you want an align threshold of 0. The reason you see data every 0.002 with an align threshold of 0.001 is that its a +/- threshold. Why would it be 16? A channel, in terms of max 16 channels in express, is a row in the channel table. When you stream the counter in DAQFactory it shows up as an analog channel. This is because of the way the labjack UD is written. You had to specify a channel number when you told it what to stream, and thus DAQFactory only knows it as an analog input, not a counter. Within the UD its treated as a channel. The DAQFactory part was written to be flexible so we didn't have to change the DAQFactory driver every time a new special channel was created on a labjack device. So, you should make your Counter0 channel, A to D channel #210 and it should receive the streaming data. You shouldn't make a separate Counter I/O type channel, as this will query the channel separately, and is probably why you aren't seeing all the data you expect. None. DAQFactory handles this automatically, putting the data into the appropriate channels automatically. You should never have to call GET_STREAM_DATA. This is actually one of the few areas where DAQFactory script differs from the commands described in the LJ user's guide. Its done this way mostly to make it easier for you and because its much more efficiently done in C by DAQFactory then with a user script.
  5. No, and actually its difficult to do in Windows from any software. The problem is that Windows security doesn't allow user level access to the I/O ports. You can only access through Kernel level drivers. For serial, the kernel level drivers have high level functions, but for the parallel port, its all handled by the spooler and print drivers so is too high of a level for fine control of pins. The only way around is to write a kernel level driver (rather difficult), or use an app that exposes the I/O ports and then turn off the spooler. That all said, its really a bad idea to use the parallel port for anything unless you are an EE and really know what you are doing. Unlike the digital pins on a LabJack, the parallel port pins are not very well protected, so if you do anything wrong, you will blow your PP in an instant, possibly killing your motherboard as well. The PP is a very tempting, cheap digital I/O channel, but using it is really a very BAD idea. Considering the cost of a U3, which gives you twice as many i/o pins as the PP and no programming hassle, its not worth even trying to use the PP even if you were an EE.
  6. AzeoTech

    DIO

    You can't use the word "channel" for your channel name. It is a reserved word. Try naming it DigOut.
  7. There is a Quick Start guide available on the LabJack website at: http://www.labjack.com/files/DAQFactory%20...%20Tutorial.pdf You should use the Device Configuration wizard to configure your LabJack. This code that you wrote: openLabJack (LJ_dtUE9,LJ_ctEthernet,"192.168.0.209",2,&lngHandle); is in C, not DAQFactory script. There is no method for opening the labjack in DF script (unless you manually load the LabJackUD.dll file using the extern command, but this is rather advanced).
  8. AzeoTech

    PID controller for dc motor by daq

    For your first question concerning analog and digital input and output, please review the guided tour. There is a generic one included in the DAQFactory help, and more LabJack specifics towards the end of that help file. As for your second question, you could try and do PID control with a U12, but with its 16ms latency, the control would not be very tight. With DAQFactory, your best bet is to use DAQFactory Base or higher which has built in PID loop control. How it applies to your application depends. I would need more detail about your hardware setup to even begin to address it.
  9. Yeah, the better solution is probably for us to just make it so ClearHistory has an option to clear the persistance. What you are seeing is that the file is not getting cleared out unless you change the length of the persist file. I think if you put a read() right before the clearhistory() it would work too, but I'm not sure. As I said, the best choice is for us to simply fix the problem, which we'll do for 5.32. Also, FYI: you really should use variables instead of V channels. V channels have very limited use ever since we introduced variables. They are largely there for backwards compatability and a few select uses. 86400 for the history is no problem. Its 16 bytes per data point, so that's only about 1-1/2 meg. Persistance is solely limited by harddisk size. You could safely have a 10 million points in your persistance. Above 100 million you run into subsetting problems as described in the help (because the index gets confused as time), but this is easily worked around. The trick when using persistance values larger than the history is that in order to access the data past the history length you have to subset. So if you graph MyChannel vs. Time you will only see the data in the history, not the persist file. If you graph MyChannel[0,100000] vs Time, then you'll get values past the end of your history and from the persist file. This is done so you don't accidently try and load 10 million points into memory at once. Please review the section on channel persistance and history in the help for more information and recommendations.
  10. AzeoTech

    DAQfactory express

    www.daqexpress.com
  11. 1) Persistance is designed to be bigger then history (or the same) only. 2) ClearHistory() does not affect persistance data, so if you call clearhistory() on a channel with persistance, nothing will really happen. This was done so you don't accidently clear a year's worth of accumulated data. To clear the persistance, use the channel parameters to set the persist to 0, then back to your setting (perhaps doing ClearHistory() in between: MyChannel.PersistAmount = 0 MyChannel.ClearHistory() MyChannel.PersistAmount = 10000 We are looking for feedback on whether this helps prevent people from losing their persist data, or is just a pain to those looking to clear the history. Perhaps we'll add a parameter to clearhistory() to force persist data cleared.
  12. Email capability is now included with DAQFactory Express as of release 5.30. All licensed users of Express can download a free upgrade at www.daqexpress.com
  13. AzeoTech

    DAQFactory express upgrade?

    Upgrades are available at www.daqexpress.com. They are free for all licensed users of DAQFactory Express.
  14. AzeoTech

    DAQfactory express

    No. You should use the channel persist feature now available in 5.30
  15. AzeoTech

    Reading NMEA Output

    This is actually a different question, as NMEA from a GPS is much different then CAN. You may be able to do it using a UE9, but I would consider it a serious waste of time. If the GPS puts out NMEA, its going to be on a standard RS232 connection which you can simply connect into your RS232 port (or through a Serial to USB adapter, which costs about $20). The trick, though is that DAQFactory-Express only supports the LabJack products. If you want to use the serial functionality of DAQFactory, which is quite powerful, you will have to purchase a regular version, which starts at $199. As I said, you can probably pull off doing RS232 on the LabJack, but I'm sure you will waste more than $199 worth of your time trying to do so. Plus, you'll get 35 new components, 16 more channels, the ability to communicate with all the DAQFactory devices, including serial and ethernet, the ability to call external DLL's, and more for that price. Check out the other versions as well that offer even more.
  16. AzeoTech

    Email sending

    I'm assuming you are using Pro. You'll need to somehow identify when the machine is off, say a digital input or something, then you can either include that in the alarm statement: (Temperature[0] > 100) && (MachineOn) or put it in the onfired event as an if statement: if (MachineOn) beginseq(sendemail) endif
  17. Logging is done with a logging set. I recommend going through the guided tour in the help file as this shows you how to do basic logging.
  18. Actually, its not even cutting it close, but rather is impossible with the U12 using software polling. The pulses are at 27 hz, but in order to count them you have to sample at at least twice the frequency so that you see both the high and the low of the pulse (think nyquist). This means you have to sample at 54 hz which is too fast for the U12. The streaming mode mentioned would work, but processing it would be more difficult. As mentioned, your best bet is to get a U3, or another U12. You can use the counter on the U12 for this, but there is only one per, while the U3 has several. Now assuming you do use a counter I recommend NOT resetting the counter, except perhaps when you application loads. The reason is that during the reset period, which is rather short, there is a possibility that you will miss a count. With a slower pulse rate like you have, this is rare, but probably would happen 1 out of ever 1000 resets. At higher rates, this goes way up. So instead, you should record the difference between consequtive counts. To do this in DAQFactory is pretty easy: 1) Create two channels, one called RawCount and one called ActualCount. The RawCount channel should specify the counter to be read with the appropriate timing information. The ActualCount channel should be a non-existant counter number (say 10), and have a timing of 0. 2) In the event of RawCount put: ActualCount.AddValue(RawCount[0] - RawCount[1]) That's it. From then on, use ActualCount for display and logging. The event code gets called with every reading of RawCount. The code simply takes the difference between the most recent point ([0]) and the next most recent point ([1]) and puts it into ActualCount. As to how to log it, I recommend going through the guided tour as that will walk you through basic logging. If Excel is putting time and force in the same column then you are probably importing the file incorrectly. Make sure you specify in Excel the delimiter as comma instead of the default of tab.
  19. AzeoTech

    resolution and voltage range

    Depends on how you have it wired. It should read 0 when pulled to ground, and 1 when at 3.3 or 5V. Note that with an open switch, the input technically is floating and could read either 0 or 1 (or any valid value for analogs). You'll need to put a pull up or pull down resistor, or use a double pole switch to avoid the float. The digital ins may already have the pull up. I'll let the LabJack guys address that.
  20. AzeoTech

    resolution and voltage range

    I would need to see what you are doing. Can you attach it?
  21. AzeoTech

    resolution and voltage range

    The problem is that your variables are initialized to invalid values for the call. The functions follow the functions described in the LabJack UD manual almost exactly, except that strings are provided instead of the declared constants (i.e. "LJ_ioPUT_AIN_RANGE" instead of just LJ_ioPUT_AIN_RANGE in other languages). Device.LabJack.AddRequest(0,"LJ_ioPUT_AIN_RANGE",Var.Channel_Number,Var.Voltage_Range,0,0) In general, the first parameter (0) is the device number, or 0 for first found. The second parameter is a particular command, in this case setting the Analog range. The third parameter varies depending on the command. In this case it is the channel number to set the range of. The forth parameter also varies, in this case it is the range value to set to. You have to look up the range in the UD header file. The other parameters are mostly not used except for certain rather special commands. With the latest DAQFactory driver, you should be able to specify range and resolution using the device configuration among many other parameters, and avoid programming altogether. If you are using DF-Express, go to www.daqexpress.com to update to the latest. Simply install that over top of your existing installation. You must have Express already installed for the updater to work. If you are using a regular version of DAQFactory, go to www.azeotech.com/dfbeta.php and get the latest beta of 5.30 which includes the latest DAQFactory LabJack driver.
  22. AzeoTech

    Win 98

    No it will not work under Windows 98. Windows 98 is a completely different operating system then 2000 and XP with a different core and a different way of multitasking. It is also notoriously unreliable, and with a data acquisition application where reliability is usually very important, windows 98 (and Me) are completely inadequate. I strongly recommend you upgrade to Win2000 or XP even if you plan on using a different DAQ application or coding your own. You can buy Win2000 for around $100. I'm not sure what the upgrade cost is.
  23. AzeoTech

    logging time

    You can't modify it while DAQFactory is using it. So you either need to quit DAQFactory, or set the logging set file to a different file so DAQFactory releases the file. DAQFactory can't let you open it while it is editing for optimization reasons.
  24. AzeoTech

    logging time

    I'm not sure what you are doing wrong. Do the three columns end up in different columns (different cells) in Excel? If not, then you are importing it wrong (perhaps selecting tab delimited instead of comma). I attached a sample showing it working. I simply typed in the first two rows of numbers you posted and then clicked on the column header for A (which highlighted the whole column) and selected Format-Cells, then picked Date from category and one of the date types.
  25. AzeoTech

    logging time

    In Excel: Just select the column (by clicking on the column header), then go to Cells-Format and select your desired date/time format.