AzeoTech

Administrators
  • Content Count

    5,729
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    SEQUENCES

    With DAQFactory you don't use eDigitalOut or DigitalIO, but rather simply create channels for your I/O and set those channels. I recommend you go through the guided tour as this shows the basics. The functions described in the LabJack user's guide for the U12 are largely not used in DAQFactory (though the U3/UE9 are), so you should not look rely so much on that manual for this information. Instead, the guided tour, the chapter on sequences and the U12 samples at www.daqexpress.com should help.
  2. AzeoTech

    Newbie sequence question

    Yes: 1) name your graph by selecting it, then right clicking and selecting Component name.... Lets say you named it MyGraph. 2) In script somewhere you can freeze the graph by doing Component.MyGraph.XAxisFrozen = 1 The other thing you could do is simply scale the graph appropriately in the x axis. This is probably a better way. So, you set the Scale From to 0 (the start), and then set the Scale To to a variable. Lets say you used GraphScaleTo. In the event your speed channel, you would put code like this: if (speed[0]) // non-zero GraphScaleTo == Systime() - starttime endif So, the graph scaling will only change when the speed is non-zero. Yup, just use the table component. This time you'll want to subset each column by time. DAQFactory will automatically subset by the time of the data instead of the index if the values in the [] are time values. So: speed[starttime,starttime+GraphScaleTo] will return an array of all values in the experiment, and only between starttime and the last graphscaleto time. You may need to add scrollbars, in which case you'll need another variable and more subsetting. Lets call the other variable TableScroll and initialize it to 0: global tablescroll = 0 Then, use a scroll bar, or buttons to change this value. In the table, your expressions will be doubly subset. For exmple: (speed[starttime,starttime+GraphScaleTo])[tablescroll,tablescroll+20] The inside subset gives us the data within the experiment, and then we further subset it to give us just 21 rows starting at tablescroll. That means as you change tablescroll, new values will appear. Did you create a v channel called starttime? Really you should use variables for this and not v channels. V channels are a bit of a left over from earlier versions of DAQFactory, and are really only useful for what you are doing with them in that calc, namely, making a dynamic variable that is simply a calculation, which saves you from retyping the calc everytime.
  3. AzeoTech

    Shutdown sequence?

    Yes, the most recent versions of DAQFactory have an OnShutDown sequence. You can read about it under Sequences - System Events in the help/user manual. Basically you just create a sequence called "OnShutDown" and that sequence will be called when DAQFactory exits, or the document unloads (i.e. new doc, or load a different doc). There is no event for page change however. For this, you should simply create buttons to change your pages and in the button actions, put your code and then change the page in code (page.strCurrentPage = "Page_0" for example). You'll then need to run your app in runtime mode so you don't accidently change the page through the workspace.
  4. AzeoTech

    Newbie sequence question

    The problem is that your expressions for your V channels result in scalars, not arrays. You can see this by clicking on the V channel in the workspace and then going to the Table tab. A graph cannot display a scalar because thats only one data point and you need two data points to draw a line. I can tell you have a scalar by looking at your expression: V. Accel = (Counter[6]-Counter[10])*0.1659-(Counter[1]-Counter[5])*0.1659 Here you have some constants (0.1659), which is of course a scalar, and you reference the counter channel. When you reference the counter channel though you are subsetting to a scalar value. [6] means return the 7th most recent value. [1] means the 2nd most recent value. So, you basically have an expressions with only scalars, so the result is a scalar. So, to get V.Accel to be an array of values you need to keep Counter as an array. How you do this depends a little on what you want, but I'm going to assume that a running count will work for. Lets assume your history is set to the default 3600: V. Accel = (Counter[6,3600]-Counter[10,3600])*0.1659-(Counter[1,3600]-Counter[5,3600])*0.1659 By doing counter[x,3600] we are getting an array of values starting at the x data point and going to the end of the history. For example, if Counter had: {1,2,3,4,5, ...} and we did: Counter[1,3600] - Counter[2,3600] this would reduce to: {2,3,4,5,...} - {3,4,5,....} or {-1,-1,-1,....} As you can see, the end result is an array, and so can be graphed. Note that [0] is the most recent value, not [1]. Also, obviously [1,3600] and [2,3600] are two different sized arrays. DAQFactory will automatically truncate the larger array to the size of the smaller array (by truncating the end, or oldest, data points). Now, for your other question. Yes, you can. To do this, you need a global variable storing the start or 0 time. Something like: global starttime and then when you want the 0 time, put: starttime = systime() Now, in your graph, put this, for example, for the X Expression: V.Accel.Time - starttime That will simply subtract the starttime from the time of each data point in V.Accel. You'll need to set the bottom axis style to "Lin" as well, turn of "Use Time Width" and set the scaling to 0 to 60.
  5. Please see reply to other post. I do not believe burst mode is supported in the U3. I thought that was a U12 feature, but as I said in the other post, the LabJack guys keep adding cool features and I can't keep up!
  6. AzeoTech

    U12 in streaming or in burst mode

    I can't keep up with all the features the LabJack guys keep adding to the U3, so they may have to correct me: Both the UE9, and therefore presumably, the U3 allow you to stream and soft poll at the same time. This means you can start a stream and then manually read other channels at a slower rate. The simplest way to read inputs at a slow rate is to simply create a channel for them and set the Timing parameter to the desired polling rate. There is no coding required. If it turns out that the U3, like the U12, doesn't support soft poll and stream at the same time, then I would just stream all the channels and average down the slow channels to the desired rate. As I just mentioned, the U12 does not support streaming and polling at the same time, nor does it stream at 4k, so you would not want to switch to a U12.
  7. AzeoTech

    Newbie sequence question

    Yes, just create a logging set and log to a CSV (ASCII delimited) file as is shown in the guided tour and in the logging section of the help. Once in CSV form you can load into any application to do graphing. The easiest and most common for most people is Excel. Great, it sounds like you have a handle on it. I hope you understand our concern.
  8. AzeoTech

    Newbie sequence question

    That is true. It just depends on how much you want DAQFactory to do for you while taking data, and how much you want to do afterwards using a data analysis tool. Personally I would log all data as jfiddler recommended and then analyze it afterwards, but if you only wanted to log after the brake was depressed, go to the event for the brake channel and add code something like this: if (Brakechannel[0]) // assume 1 means brake depressed, 0 not beginlogging(mylog) endif You'll have to stop logging manually, or use an event on the speed channel to turn off logging when it gets to 0. Finally, I delayed initially responding to this post because I am concerned about the danger of modifying a motorcycle and the potential of adversely affecting the braking system on the bike and injuring yourself. This is much more of an issue on a motor bike than a car. Remember, even tapping into an existing system can cause problems if not done correctly, especially with today's advanced automotive systems. Tapping into safety systems (like brakes, airbags, steering, etc.) should only be done by the manufacturer of the safety systems and with proper testing. For this reason AzeoTech is strongly recommending that you do not do this experiment on the road and instead do it on a stationary dyno, which is the proper place to do it and would be much, much safer. Even if you do it on the dyno, you should probably replace any modified parts before riding the same bike on the road. Please re-read the end user license agreement of DAQFactory and the warning in the beginning of the LabJack manuals as well.
  9. Its actually quite simple. Create a channel with I/O type "Special", channel #0 and set the timing to your desired polling interval. Then create another but channel #1 with a timing of 0. The temperature reading will go into channel 0, and the RH into channel 1.
  10. The LabJack guys will have to confirm this, but I believe for the timers work with discrete signals and not analog signals like you have. Technically you could probably stream the signal as an analog signal and let DAQFactory calculate the timing, but this won't give you the precision since the timers have a much higher time resolution than the streaming analog. So, personally, I'd use a schmidt trigger to convert the analog signal into a digital signal. Again, the LabJack guys (who are much better at hardware than I am) may want to chime in on this and make some recommendations. For example, I don't know if there is anything special in getting a schmidt trigger to work on fast signals. In general, a schmidt trigger is a very simply circuit that you should be able to create with components from Radio Shack.
  11. Inserttime is a function, just like Sine. Lets say you have a variable that you want to put time into. There are actually two ways you can do this: myvar = inserttime(myvar,systime(),-1) or: myvar.time[0] = systime() Then you can put the value in a channel using AddValue(): Mychannel.addvalue(myvar) You cannot change the time of a channel value once it is in a channel.
  12. AzeoTech

    Streaming from the sound card

    To get you started, I've attached a simple stream example of 4 channels. To get the peak along the left side of the graph you should calc the max of the scan, get the time of that point, and set the ScaleFrom to that time and the scaleto to that time plus whatever time width you want. So, for example, you might put: GetTime(Max(AIN3)) for ScaleFrom and GetTime(Max(AIN3))+1 for ScaleTo to get a graph with just one second width. To put the max on the right side, switch it and do -1 instead of +1. Note that you'll need to uncheck "Time Width" to enable the scalefrom/scaleto in the graph. I'm not quite sure what you want with the "automatic timebase management", but check out the shifttime() function, which would allow you to adjust the different traces in time. You would use it in the secondary traces. So if you want all the max peak of two different traces to appear along the left side of the graph where the maxes may occur at different times you would start with the code I mentioned above to set the X axis scaling, and then (assuming your other channel was AIN2), you'd create two traces. The first trace would have a Y Expression of just: AIN3 the second would use shifttime to move the max of AIN2 to the same time as the max of AIN3: ShiftTime(AIN2,GetTime(Max(AIN3)) - GetTime(Max(AIN2))) Note, of course, that the time axis is only the time of the datapoints of AIN3, though the deltaT will be the same. We didn't scale time, we just shifted it to align the peaks. Finally, lets say you want the peak to appear just to the right of the left axis so you can see the leading edge of the peak. In this case, just subtract a little from the scalefrom and scaleto: ScaleFrom: GetTime(Max(AIN3)) - 0.1 ScaleTo: GetTime(Max(AIN3)) + 0.9 Then, just to top it off, if you then wanted to mark the max point (which would then be 0.1 seconds from the left axis), you could use a line annotation to put a dashed line. The line annotation would have an expression of: GetTime(Max(AIN3)) and you'd select the Bottom Axis. I guess the key point that I never mentioned is that when you do Max(AIN3), this returns the max of AIN3, but it also keeps the time of the max in the value as well. DAQFactory keeps time associated with values, and to retrieve the time portion of the value, we use the GetTime() function, so GetTime(Max(AIN3)) returns the time of the max point of AIN3. This can be used for Min as well. The rest of this is just doing math on the time, remembering that time in DAQFactory is just a number that corresponds to the number of seconds since 1970, so it can easily be added or subtracted. ShiftTime() does this to the time portion of a value, returning that same value with the time shifted by the given amount. Finally, I attached my expansion on the stream simple document that shows this peak alignment working. I didn't have any input and so the values were just floating around 0.15, except of course when I touched the inputs, which would generate a nice peak. You may have to adjust the y scaling to better see your peaks. Just double click on the left axis. As you can see, once you get a little experience with the various functions of DAQFactory, it is real easy to manipulate data to get what you want. U3_Stream_Simple.ctl U3_Stream_Simple_Peaks.ctl
  13. Not in the current release, though DAQFactory will remember the full screen state and restart in the same state. The next release has a document setting for full screen mode.
  14. AzeoTech

    Email attachments

    That's definitely a server error. Not one of seen before I'm afraid. It appears that the server doesn't like the encoding of the attachment. We've had email support for several years and this is the first I've heard this error. My recommendation if you don't want to chase down the server problem is to skip the attachment altogether and put the file into the body. You said you were doing a .csv file, so its text already. Use the File. functions to load the file and put it into the body. It'd be something like this: // open the file private.handle = File.Open("c:\mydata.csv",1,0,0,0) // get the length private.length = File.GetLength(handle) // read the entire file and put into the body of the email email.strBody = File.Read(handle, length) // close the file file.Close(handle)
  15. 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 = "xxx.xxxxxx.com" email.strUserName = "xxxxxxxx" email.strPassword = "xxxxxxx" email.strAuthenticate = "AuthLogin" email.strBody = "test" email.strTo = "xxxx@azeotech.com" email.strReplyAddress = "xxxxx@azeotech.com" email.strFile = "c:\trimtable.csv" email.Send() This worked perfectly.
  16. 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.
  17. 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: http://www.labjack.com/files/firmware/ue9/beta/ 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.
  18. 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?
  19. 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 http://www.cryptotech.com/en/support/crypto_box/download.php 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.
  20. 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 www.daqexpress.com and www.labjack.com 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.
  21. 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.
  22. 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
  23. 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.
  24. AzeoTech

    unknown error-codes

    First, I'd make sure you have the latest versions of everything. Go to www.daqexpress.com to get the latest DAQFactory Express. Go to labjack.com 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.
  25. Certainly, just add a delay inside the for loops: for (private.c = 0, c &lt; 5, c++) read(Eingang0) delay(0.1) endfor