• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. Well, good. I'm glad you understand wait(), and you should definitely migrate back to it once you get the system stable. However, I still recommend you switch to delay(), at least temporarily, to see if this is the problem. You have a lot going on in your code and the wait()'s might not be acting the way you think. Switching to delay() is the easy fix. If it doesn't work, we can take a closer look at your document. Unlike Windows, which seems to think that all their users are incapable of properly using a computer (and many are incapable), and thus simply keep you from doing things so you don't get yourself in trouble even if you know what you are doing (my recent favorite is that you can't share the program files directory, even if you are logged in as an admin), DAQFactory gives you complete flexibility, but with it, comes the possibility to create scripts that actually cause DAQFactory to hang. The two most common ways are: 1) creating infinite loops at priorities at or above User Interface, without the proper delay to allow the GUI to run 2) putting code in component actions, or starting functions from the command line that are not quick (I even forget this second one sometimes . This is because the code runs in the GUI thread and so the GUI stops while the code runs, meaning DAQFactory appears hung. Screen refresh is part of the GUI too.
  2. OK, we received the file through the AzeoTech support center and taken a quick look. Before I jump into the problem, I'm afraid I have to give a short lecture. I don't like to do this because the customer is always right, but it is globally acknowledged among programmers that not following good code indenting is very bad. It makes code very difficult to read. I very strongly encourage you to gain that habit and use it, especially since you are writing more than just a few lines of code. Not only will it allow other people to help you debug your code, but in a few years when you go back and review the code yourself, you'll have a much easier time figuring out what you did. I should add, though, that if you see code on a web page (or our help system, which is HTML, though I believe we have it all proper), it may not be properly indented. This is because of the way HTML parses spaces, making it somewhat more difficult to indent using normal HTML. You can type in code indented, but HTML displays it incorrectly. This forum does a pretty good job with it, provided you remember to put a CODE block around it. DAQFactory, however, provides lots of good tools to help with indenting, such as the ability to select a block of code and hit Tab or Shift-Tab to indent / outdent. That all said, most likely your problem is that you are using the wait() statement instead of the delay() statement. As it says in the documentation, and should even warn you about in more recent releases, the wait() statement should only be used in very specific circumstances and can cause hanging if used improperly. This is because the number inside the wait (i.e. wait(3)) is the maximum wait time, not the absolute wait time. The actual wait time can be much shorter, even 0, if there are delays elsewhere. If your loops are running slow, the wait will go to 0 and then chew up 100% of your processor time since you effectively have an infinite loop with no pauses to allow other parts of DAQFactory to run. An infinite sequence running at priority 5 will run above the user interface priority and so can make DAQFactory appear hung. So, try changing all your wait() statements to delay() and that most likely will fix the problem. For those wondering why there is even a wait() statement, its to allow for loops that run at an exact time interval. So: while (1) .. do something wait(1) endwhile will cause the loop to run every second no matter how long "do something" takes, provided its less than wait amount, in this case 1 second. If you instead did: while (1) .. do something delay(1) endwhile the loop will run at more than a second, actually the sum of 1 second (the delay) and the time it takes to "do something". As I said, the problem with using wait() is that if "do something" gets delayed for more than a second, the wait() will not wait at all, trying to catch back up with the proper loop interval, and can cause DAQFactory to hang. This is why you should never use wait() with serial/ethernet communications, and really only with devices that always respond quickly (like PCI cards). The more recent versions of DAQFactory will warn you not to use wait() the first few times when you apply sequence code that contains a wait().
  3. OK, so you are saying that DAQFactory stops responding, but the rest of windows is still running. This could be caused by some problems in your document. Can you please attach your .ctl document so we can review? If you don't want to make it publically available, go to and the contact page and post it their so it goes direct to us. We no longer post email addresses because of spam crawlers (which has gotten horrific, as I'm sure you know), which is the only reason I'm not simply giving you my email address here.
  4. AzeoTech

    DAQFactory versus LabView

    The ability to create protocols quickly within DAQFactory is a relatively new and powerful feature and so we haven't had much time to build up a big collection, but are certainly working on it. We'll be expanding our site a bit in the coming months and will start adding these in, but there is no master list. Many people are able to simply develop it themselves and so we never see this code. We may try and create an area where customers can share their protocol drivers.
  5. So are you having the same problem, or is the PC now crashing? Does it crash at a particular spot? How does it crash? Blue screen? hang? Message? These will give me clues as to what is causing the crash. DAQFactory does not have any problems with multi-core or multi-processor systems. In fact, as a very multi-threaded application is will take full advantage of as many processors as you throw at it, and was developed entirely on multiprocessor machines.
  6. AzeoTech

    DAQFactory versus LabView

    It all depends on the protocol. The hardest part sometimes is actually finding documentation for the protocol, especially if the device is not made anymore. If you have documentation, most devices fall into one of two types: simple ASCII, and binary with CRC. There are more complex protocols, such as DNP, but they are much more modern. Depending on your experience and desire, you can actually use the tools provided by DAQFactory to write your own protocol drivers. Its not terribly hard and we include a nice PDF primer on this in the download. We are of course here to help, which can be answering questions to help you develop your own protocol driver, or having us take care of it for you. Prices range from about $200 to $2000 depending on the complexity of the protocol and how many different functions you need implemented. So, $200 might be for a driver to allow you to read the temperature from a PID loop controller, and set its setpoint using a straight ASCII protocol, and $2000 would be something like implementing binary PLC driver with all functionallity. Pricing also depends on how reusable we think it is. If we think that many customers will benefit from the driver, then we typically discount the costs. If there is a particular protocol you are interested in, just email documentation on the protocol and we can give you a fixed price quote. I took a brief look for HP3585 docs on the net but couldn't find them. Oh, one other thing that is quite helpful is if you actually have the desired device and it is hooked up to a computer connected to a high-speed internet connection. We have tools to allow us to remotely connect in and test. Actually, Base does not come with the symbols, but that's just a minor detail (you can see what's included with what by going to this page: The easiest way to add new symbols is to simply create them in your favorite drawing program (say Photoshop) and cut and paste into DAQFactory. This works on all versions, even Express. With Standard and higher, you get the symbol library, so you can also put your own custom symbols in this library. The symbols are mostly drawn using vector graphics, so a program like Illustrator works best, or there are a few shareware WMF drawing programs available. These programs, or even Photoshop or other bitmap editor can be used to modify the existing symbols, though if you use a bitmap editor, you will lose the ability to scale or rotate the image within DAQFactory, so you'll want to draw it at the desired size. One of the most common ways people use images is to actually draw out the background (static parts) of their pages in Photoshop and then overlay dynamic components within DAQFactory. This is actually how the QuickMod program gets the rounded rectangles. You can also see it in the AshlandWater.ctl sample, where a bitmap map of Ashland is overlaid with dynamic controls. This sample also shows how to make what would be called a client side image map in HTML, allowing you to click on areas of the map and switch to different pages. A panel component is simply placed behind the image with click Action.
  7. AzeoTech

    DAQFactory versus LabView

    First, in all the paid versions you get all 40 some screen components. If you buy Standard or higher you also get the 3800 symbol library. So, to answer your main question: Yes, most everyone has heard of Labview, largely because it was probably rammed down their throats in Engineering school, partially because NI has a billion dollar budget, and partially because its been around for 30 years or so. Its not quite the same as your MS Word analogy because really there are only so many ways to do word processing, and so most word processing apps are the same. LabView and DAQFactory are quite different approaches. The main difference is that LabView programming is done with a mouse, drawing lines between different screen components, where DAQFactory is a regular structured text scripting. Personally, as a structured text programmer, I find LabView difficult to understand as it is a complete different paradym then regular programming. Unless they are a LabView expert, I think most people agree. We get a lot of people that come over to DAQFactory because LabView is so difficult. With DAQFactory, anyone with any programming experience in almost any language can very quickly figure out the syntax and make quick progress in developing applications. With LabView, really only LabView experts are going to be able to help you if your application is of any complexity. Yes, there are a fair number of LabView experts, but a pittance compared to the number of regular programmers in the world. There are a few other apps that use a similar method to LabView, i.e. DASYLab, but DASYLab was actually sued and taken over by NI because of the patent infringement, so when you are actually buying an NI product (of course, the same applies to Measurement Computing and IOTech hardware, though they were simply bought by NI a year or two ago). The other big difference between DAQFactory and LabView (and every other application that I know of) is that DAQFactory allows you to make changes on the fly without stopping your application and recompiling. So, if you decide you need a new graph halfway through your experiment you simply drop one in. With LabView, you'd have to stop the app, make the change, then restart, hoping that your equipment remained in a stable state while the computer wasn't controlling it. With DAQFactory, even on runtime installations, you can put a hardware key in and temporarily switch it to development mode to make changes on the fly. The advantage of this is not just the fact that you don't have to take the system offline, but also that it makes development faster and easier because you get immediate feedback on what you are doing. When you drop a graph on the screen and change its parameters, you see data immediately in the graph and can tweak it right there and then. There are probably three areas where LabView is better than DAQFactory: 1) LabView has a lot more analysis tools, so if you are doing heavy duty engineering calculations, LabView has the toolkit. DAQFactory is a bit more of a HMI/SCADA app and so doesn't have the real high end toolkits, though you could simply buy a C library and call it from DAQFactory. 2) LabView supports many more hardware devices. Among DAQ devices at least (not automation devices), manufacturers basically have to make a LabView driver if they want to survive. So, National Instruments doesn't have to do any drivers, a lucky position to be in. DAQFactory isn't supported by every DAQ card manufactured but with its ability to call external DLL's and its powerful serial/ethernet tools you can expand it yourself or have us create a driver for you. 3) LabView has a lot more samples available. Of course without the samples you wouldn't get anywhere with LabView, and even with them, there is still a steep learning curve on LabView. DAQFactory really makes up for it with our stellar support. Just ask anyone who has worked with us. With NI, you'll get someone reading out of a book, with AzeoTech you'll get someone who was involved in development of the product and knows it top to bottom. So in my personally, and obviously biased opinion: Definitely use LabView if: 1) you have a LabView expert on staff, or you yourself is a LabView expert already. 2) you need to do a lot of really advanced data analysis that NI's toolkits cover 3) you need to use a lot of different DAQ hardware, or NI's high end stuff. When I say DAQ hardware, I'm talking mostly about internal PCI based cards or USB based devices like, but not including (because DAQFactory supports it already), the LabJack. Definitely use DAQFactory if: 1) you have experience programming in structured text (i.e. normal programming) or access to a regular programmer and don't have time to spend months learning LabView 2) your data analysis needs are bit more normal 3) you are creating an HMI / SCADA application or really anything for industrial automation 4) you are using DAQ hardware primarily from one manufacturer (and thus we can create a driver for you easy), you are using devices that are connected through serial or Ethernet, or if you are connecting to any sort of automation device (PLC, RTU, etc). 5) taking your system offline for a change is a big issue 6) if you value good technical support
  8. I forgot to mention. Another thing about 5.7 is that you can select multiple components and change common properties on these components all at once. Among the common properties are the event and function script, so, to some extent, if you need to update script you can just select all the components and make the change. Of course this only really works if the components are on the same page, or overlayed pages. No sense on 6.0. We just released 5.7, so the programmers deserve at least a day off! We are always looking for beta testers. Send an inquiry using our online form at with your interest.
  9. Unfortunately, no matter what development tool you use, there are always some clumsy aspects. That is until computer's start thinking for us, and really, I don't think you'd like that. Windows does enough of that already and most of the time it does it wrong. But to answer your questions: 1) There are no component templates in the sense that you change in one place and it changes on all. As of 5.70 there is the ability to add functions / events to components as well as your own custom properties, but its not a template. If you duplicate the component, the code duplicates, but if you then change one, the duplicate does not change. We'll add templates to the list of new features. The trick is trying not to make things too confusing, as half the time you want it to be a template so it changes everywhere, and the other half you wonder why your change affected all the other controls. That said, you can kind of implement it as a template by using a component function and then having that function call a global sequence function with its name as the parameter. A bit clumsy still. Or you could use the new messaging functionality to actually send the component the code it should execute. Fortunately we also made it so it will auto-name your components, if you put a number at the end. So if you name your first component Button1, and then duplicate it, the duplicate will be named Button2, etc. Anyhow, I guess I'm going around in circles. If I was doing your app, was using 5.70+, and wanted to be able to change the code on all 64 buttons in one swoop, I'd probably use either use the user properties feature, or determine the property from the channel name (i.e. use the number at the end so I didn't have to type in Channel1, Channel2, etc. for each component). For the display part, I'd use the OnPaint event and set the Expression to the appropriate channel based on the component name. Then I'd probably create a global variable containing the function code to execute when the button is pressed. I'd assign this code in a startup sequence, and then in the button's event, just do Execute(MyGlobalString). The trick to this method is to understand that Execute() can be used on multiple lines of code with a single call. Just put a chr(10) at the end of each line. So you might do (I'd recommend a different variable name!): global string MyGlobalString MyGlobalString = "private x = 2" + chr(10) MyGlobalString += "x++" + chr(10) MyGlobalStirng += "? x" + chr(10) Now if you did Execute(MyGlobalString), it would run that code in whatever context you did the execute(). So you can use local variables from a component, even though they don't exist in the global scope where you created this string. The nice part about it is that you can just edit this string to change all components that use it. 2) Unfortunately, DAQFactory does not yet have pointers, or for those that are scared of the word "pointer", references. We are working on it rapidly and it should be in place by release 6.0. In general, if you are advanced enough to want to use pointers, you might want to consider just using variables instead of channels. With 5.70+ (at least on non-Express versions), there are functions to allow you to add values to variables just like a channel. Its much faster, but you lose the ability to use built in Logging sets (not export sets), and broadcasting, and would have to trigger alarm checking manually. Oh, and you'd have to script the polling loops. But, again, if you are doing advanced stuff, you probably are scripting this stuff anyway so you have more control. Again I ramble. Until there are pointers, you are going to have to use Execute(). Remember though that you can do a single Execute() command and run lots of code as I described above. A single Execute() with 5 lines will run faster than 5 executes with a single line. Currently, all function parameters are passed by value, so if you pass a channel history, it copies the current contents first, so any changes to this array will not affect the history. We hear your pain and are working on making things easier without having the computer think to much for you. 5.7 is a step in the right direction and by 6.0 your dreams will come true . Note that 5.7 is that latest release of DAQFactory and is available from our website at Upgrades are free. The Express version of 5.7 has not been released, mainly because we haven't updated the samples, but we'll probably just release it next week and update the samples afterwards. One of the big changes in 5.7 that affect LabJack users in particular is the updated driver that supports almost all the functions of the UD as is, meaning the code you would enter to work with the UD in C, or VB, or other languages, and thus the pseudo code in the LabJack manuals, is almost identical to the code used in DAQFactory, with the exception of streaming, which DAQFactory largely handles for you.
  10. AzeoTech

    multiple daqfactory programs simultaneously?

    Yes and no. Channels and components are pretty easy. Channels you can export then import, and components you can simply cut and paste. Conversions, however, would require retyping, same with logging, export sets. One thing many people do is create a single document and then use a flag, perhaps set in the StartUp sequence, which determines which parts of the program run. This allows them to keep one code base for their application. Its appropriate if there is some commonality, but if you have two completely separate apps, I'd just run them simultaneously and see how that works. The flag method also doesn't work too well if you are using channel timing. To make it work right, you'd have to dynamically create your channels.
  11. AzeoTech

    multiple daqfactory programs simultaneously?

    I'm afraid I don't have a definitive answer for this one. It depends on many things. In general, you can have more than one copy of DAQFactory running at the same time on a single computer. With express there definitely should not be a problem. With full versions, you can sometimes run into problems if you are using the hardware key. What happens is if both copies try and validate the key at the same time, one of the copies will think the key is missing and throw up a window. Fortunately, you just say "Retry" and all is well, but it can be annoying. Truthfully, I'm not really even sure that this is an issue anymore due to some internal changes we made recently. That's the DAQFactory side. The question then is whether the LabJackUD can handle being called from two different apps at the same time, even if those apps really are just the same app being run twice. This is the part I'm really not sure of, and you'll probably just have to try it, or perhaps the LabJack guys can address it I know that you can run into problems if you are running DAQFactory and fire up the LJControlPanel, but that may be because LJControlPanel accesses all the labjacks and does other things that only the LabJack guys know. If you kept the two apps separated, i.e. each communicating with a different labjack, then you'd probably be ok. Finally there is the licensing issue: if you have two labjacks, then technically you have two Express licenses and therefore you are ok to run two copies simulataneously on the same PC. If, however, you run more simulataneous Express apps than you own labjacks (and therefore Express licenses), then technically you are in violation of the license agreement as you are essentially trying to bypass the limitations of Express (i.e. get 4 pages instead of 2) In the end, this is probably a moot point as I really doubt that two different copies of DAQFactory running simulataneously on the same PC can access a single LabJack at the same time. You are therefore much better off simply buying DAQFactory-Lite for $199 and saving yourself a whole lot of problems. You'll also get unlimited pages, 30 more screen components, access to other devices and other features.
  12. AzeoTech


    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 should help.
  13. 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.
  14. 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.
  15. 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.
  16. 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!
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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
  24. 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.
  25. 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)