AzeoTech

Administrators
  • Content Count

    5,686
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Importing picture

    The best way to ensure the graphic displays right in DAQFactory is to open it up in Microsoft Paint and then cut and paste it out of that program. DAQFactory currently cannot resize bitmap images.
  2. AzeoTech

    0 - 5Volt Fader

    I think we're confusing the term initial voltage. There are two initial voltages really: 1) When the program starts, it initializes the output to a starting voltage. This is the one to use the registry with. 2) When the ramping loop starts, it has an initial voltage to ramp from. This is stored in Var.InitialVoltage and is set by one of the screen components I made in that sample, so is already user settable. My previous post with the registry assumed you were trying to solve #1 since #2 is already implemented. A registry variable is a variable that instead of being stored in memory is stored in the windows registry. Because of this, it persists even if you reboot your computer. Its limited to integers and strings so actually I should have added a multiplier in to allow for non-integer starting voltages. I only suggested using the registry variable in the startup sequences to set the initial voltage on the analog output.
  3. AzeoTech

    HEX display

    Well, I've had cases before where customers didn't quite get that binary, decimal, and hex are all the same thing when talking about numbers. They are just different ways of displaying them. Usually are only two cases where you need to actually do a conversion: 1) With ASCII serial communications when the device sends a string containing a hex value and you need to convert that to base 10 (decimal). 2) When you have a number and for some reason you want to see it displayed on screen (or logged) as a hex string. The key is that the hex values are strings not numbers. A number is a number is a number, it doesn't matter if its hex, decimal, octal or base 23. The computer is going to represent it internally the way it wants and you'll never know. Its only when you want to display it, which requires you to convert it to a string representation, or you want to go the other way and take a string representation and make a number that it makes a difference. That all said, to convert a string hex value to a number you use the expression: Evaluate("0x"+var.strMyString) or if a binary string, use "0b" instead. Under DAQFactory 5.15 there is no way to display a number as a hex string, but in DAQFactory 5.30 you can use the Format() function: Format("%x",var.myvalue)
  4. AzeoTech

    More questions about sequences

    Sorry I didn't see this post earlier, but perhaps the response to your next post answered the questions. Since others may read this, here is the answer to this question: The problem here is that the detect sequences pretty much get started immediately on load before those inputs have had a chance to read. To avoid this error, you can just put a delay(1) or similar to delay the start of those sequences until after the channels have had a chance to read a value. You have the AddValue() functions which should avoid this. Did you still get the error with those lines in place? If so then you have something else going on (like a history of 0 or something) and I'd have to see your document. As I mention in the other post, you need a loop with a delay() in it on these detect sequences to get them to continually monitor. A few more pointers: 1) When monitoring channel values as you are, its actually better to use the Event on the channel instead. The event gets called every time a new value comes in on that channel. By using an event you avoid the C1040 error, avoid having lots of loops, and get quicker (actually the quickest) response. The code in your event would actually be the same as what you have in your detect sequences, except the if's would be with the appropriate channel. Note that you would never want to put a delay() in a channel event as that would stall the next reading. 2) If you want an easy way to avoid startup alerts like this, assuming you had a loop in those detect sequences, you can always add: ignore("all") or just: ignore("C1040") to get the sequence to ignore all errors or errors starting with C1040.
  5. AzeoTech

    0 - 5Volt Fader

    The start voltage is user set. Its called "Var.Initialvoltage" Or did you mean the voltage when the application is started? If so, use a registry variable. So, right now, you have in the startup sequence: Output = 0 Put this instead: Output = Registry.StartVoltage Then create another variable value component that changes the Registry.StartVoltage variable. Then, when you change this variable and restart, the output will be set to that value. Note that Registry variables default to 0.
  6. AzeoTech

    0 - 5Volt Fader

    Did you remember to create the output channel? I've attached a sample showing it working. I didn't know whether you had a U12, UE9, or U3, so I made the Output just a test channel. Hopefully you can build from my sample. As for it being hard, well data acquisition is not super easy, and anyone or anything that is making it really easy is probably hiding things from you that you should understand otherwise you may be trusting results and actions that aren't correct. My favorite example of this is with the discovery of the ozone hole. When the ozone hole was discovered, there was already people measuring ozone for years who never saw the hole. When the announcement was made, they went back and discovered that the programmer, who had made it "easy" for the scientists had made it so values below 50 were marked invalid, thus throwing away all the real data that showed there was a hole. As for other programs that might be easier, well only if you happen to find a program that does exactly what you want. LabView will be much harder, any programming language (VB, C, etc) will be as well. The problem is that everyone needs to do things differently. The first versions of DAQFactory had very limited scripting and tried to avoid programming, but we quickly discovered that then DAQFactory only worked for a very small subset of people who happen to need the features we offered. We thought about simply adding more features, but then the program just gets combursome with menu options. The only way to allow the flexibility to do all the different things people want to do, you have to use some scripting. Unlike LabView, and low level programming languages, DAQFactory takes care of a lot for you. Plus you can use a lot of the non-programming features and just supplement it with some scripting for your unique application. And then of course, you can always post here when you have problems and get a quick answer risesample.ctl
  7. AzeoTech

    0 - 5Volt Fader

    The private means the variable is only visible from within the sequence. This is done to avoid cluttering the global namespace. Basically that just means it is done to keep from having too many different names accessible globally. With DAQFactory 5.30 this becomes even more of an issue for reasons I'll skip for now. Anyhow, in general if you just need a variable in a single sequence you should use a private, and if you want to change it elsewhere you should use a global (var.) variable. Var. variables can be used any place you would use an output channel, so, for example, you could create a Variable Value component and then open its properties, click on "Analog Out" button in the bottom right and enter "Var.TotalTime". What this button does is set the Action of the component (on the Action tab of the properties) to "Set To" and the set to channel to the Var.TotalTime variable. The SetTo action prompts the user for a new value and then sets the variable to that value. If you have not done so already, you may want to go through the Guided Tour in the help / manual. And for more info on variables, and the scripting code, review the chapter on sequences.
  8. AzeoTech

    0 - 5Volt Fader

    OK, well here's a sequence that slopes a D to A output over a fixed amount of time and at a certain update rate: Var.TotalTime = 300 // total change time in seconds Var.UpdateTime = 1 // how often to change output Var.InitialVoltage = 1 // starting voltage Var.EndVoltage = 5 // ending voltage // note that the above could be set elsewhere, for example with a screen component private.starttime = SysTime() while (SysTime() < Private.starttime + Var.TotalTime) Output = Var.InitialVoltage + (SysTime() - private.starttime) / Var.TotalTime * (Var.EndVoltage - Var.InitialVoltage) delay(Var.UpdateTime) endwhile Output = Var.EndVoltage // make sure we are at end since last step could be missed So, in the meat of the loop, we first record the time we start the transition. Then, while the totaltime has not elapsed we loop. On each iteration we set the output channel. The formula is made up of several parts. The (SysTime()-private.starttime) / Var.TotalTime returns a number between 0 and 1 where 0 is the start and 1 means the total time has elapsed. We then multiply this by the total voltage change and add that to the initial voltage. After setting, we delay for the update interval and then loop. When the loop quits, we set the output to the target voltage to ensure we got the last step. This is because depending on the timing of the loop the final output setting might not occur within the loop.
  9. AzeoTech

    0 - 5Volt Fader

    I'm not really sure exactly what you are trying to do. But first, and I only mention it because if I don't say it, you may never know, but 0-5volt is voltage not current. Current is typical in units of Amps and a power supply that allows you to vary the current is a completely different beast. OK, that said, you have just a regular variable power supply with a pot to adjust the voltage on the PS. You want to be able to set the power supply to 5 volts from within DAQFactory no matter what the pot says? If so, this is actually a bit trickier then you'd think. You have to look at the Pot and see what it is doing. If its just a simple voltage divider on the output, then you could use a relay to bypass it. If its controlling some internal circuitry, you have to figure out how it works. It could be grounding the circuitry to set it to 5V or doing the opposite. That's why its tricky, and if done wrong you could blow the power supply. What you may want to do is keep the power supply set at 5V all the time, and then put your own bypassable pot downstream of the powersupply. Truthfully, I'm the software guy, so perhaps others can contribute here about how best to implement the hardware side. So, moving on to my area: what do you want the software to do? Do you want it to control the voltage all round (if so you can use an I/O module)? What determines what voltage to output? As for your code: 1) Pretty much any time you want to monitor an input you should use an event as I showed you in your previous enquiry. 2) There is no "then" statement in DAQFactory 3) "(Digout + 1)" is not a valid statement either since it doesn't say where to put the value digout+1. "Digout = Digout + 1" is valid, or "Digout = 1" 4) There are only very rare reasons to use wait(). You should use delay() instead in general. 5) The indenting should look more like this: while (1) read(inputvalue) if (Inputvalue <= 5) Digout = 1 endif delay(1) endwhile
  10. AzeoTech

    timer function

    I'm a little confused want you want, but I believe you want to monitor a digital input and if it goes high (i.e. switch closed) you want to light an LED for 15 seconds by setting a digout high and then low again after 15 seconds. To do this, you'll of course need a digital input and digital output channel. Lets say they are called DigIn and DigOut. 1) In the event for DigIn (click on the "DigIn" in the workspace under CHANNELS: then select the Event tab), put: if ((DigIn[0] == 1) && (DigIn[1] == 0)) beginseq(PulseLED) endif This looks for when the digital signal goes high after being low. 2) Next create a sequence called PulseLED and put: DigOut = 1 // turn on LED delay(15) // wait 15 seconds DigOut = 0 // turn off LED The event will cause this to run when the switch is pressed. If the switch is pressed while the LED is already on nothing additional will happen.
  11. AzeoTech

    question about sequence execution

    Oh, and since this seems to be the question of the day and relates: The only way to control the order in which multiple sequences auto-start is to do what you did and create a single auto-start sequence and have that start your other sequences.
  12. AzeoTech

    question about sequence execution

    No, sequences run until they don't have any more statements to exectute. A sequence will only run forever if you have a loop in it. So this sequence: var.a = 3 var.b = 4 beginseq(myotherseq) will set a and b and start myotherseq and then stop since it ran out of things to do. However, this sequence: while (1) var.a = 3 var.b = 4 beginseq(myotherseq) endwhile would repeated set a and b and try to start myotherseq. "while(1)" means loop forever because 1 is the same as true. Since myotherseq is probably already running the second time around, it will not restart it, but instead the second and subsequent execution of beginseq(myotherseq) would probably do nothing. Once myotherseq stopped though some other means, this sequence would restart it. Please note: you would NEVER want to do the second sequence as it is essentially an infinite loop. If the sequence priority was anything other than 0, you would most likely hang DAQFactory. If it is 0, your graph and image drawing might be sluggish. Instead, you should pretty much always have a delay() inside the loop. The delay typically should be at least 0.01: while (1) var.a = 3 var.b = 4 beginseq(myotherseq) delay(1) endwhile
  13. AzeoTech

    HEX display

    Well it depends. Where is this binary value stored? In a string I presume?
  14. AzeoTech

    DAQFactory file compilation

    No, this is not possible with DAQFactory. The Runtime License is required.
  15. AzeoTech

    Importing picture

    There is not a way to directly import a picture into DAQFactory. However, you can copy and paste images into DAQFactory. You might need to resize your image with another program before pasting it into DAQFactory. Once you paste the image into DAQFactory, it becomes a symbol component. It can be a static symbol or you can animate/change the symbol based on a value. For example you could change the symbols location based on a value.
  16. A simple sequence such as the following will store the bits to an array in the variable Var.Binary. Var.Decimal = 255 Private.j = 0 for (Private.i = 7, Private.i >= 0, Private.i--) Var.Binary[Private.j] = TestBit(Var.Decimal,Private.i) Private.j++ endfor
  17. As LabJack Support mentioned, the easiest way would be to use original integer with the TestBit() function rather than the string. However, if you prefer to use the string, there is a way to do it with the Evaluate() and Mid() functions. For example: if your string is Private.strBinary and you want the third bit do something like this. Var.thirdbit = Evaluate(Mid(Private.strBinary,2,1)) The Mid() function returns a subset from the center of the string. From the above code it will look skip the first two characters (2) and then return a single (1) character. The Evaluate function converts the character from a string to a value that you can use in mathematical functions. You may or may not need the Evaluate function.
  18. Email functions are not supported in DAQFactory Express, although this is easily accomplished with a higher version of DAQFactory. The cheapest version to support Email functions is DAQFactory Base which retails for $399 USD. See the following link for a list of features for each version and their respective price. http://www.azeotech.com/dffeaturegrid.php You mention that you use eight channels for the voltage to fahrenheit conversion. Instead of taking up channels for this conversion you could do a conversion using CONVERSIONS: under the Workspace and applying it to the appropriate channel. Or another way to do it without using up channels is to do the conversion directly in a display component.
  19. AzeoTech

    Factory Express - playback

    With DAQFactory you can reload data from files to view it at a later date. Unfortunately this functionality is beyond the scope of DAQFactory Express. There is a sample on the Azetoech Knowledgebase that shows how to do this, but you would only be able to use this sample with a higher version of DAQFactory. The following will link you to where you can download the sample. http://www.azeotech.com/faq.php?do=article...le&articleid=76 A possible way around this (using Express) is using the Vchannels. You could save each batch of data within the program into Vchannels and then graph the Vchannels as you want to see them. The best way to do this is by creating a Vchannel (virtual channel) and then in the Event of your regular channel add code like this. V.MyVChannel = MyChannel[0] Everytime an new data point is read into MyChannel it will be saved into the Vchannel V.MyVChannel. Of course for every new batch of data you will need to create a new Vchannel and change the code in the channel Event. One other thing to note is that since you are storing all the data inside the program rather than in separate data files, the size of the program can get large.
  20. AzeoTech

    DAQFactory Express

    DAQFactory Express has been shipping with the LabJacks for over a year now, so if your LabJack is older than this it is possible that it is not on your installation CD and you should contact LabJack at support@labjack.com. If your LabJack is less than a year old, run the installation from your CD again and make sure you check the box to install DAQFactory Express. After the installation is complete, DAQFactory Express will show up as it's own program group under Start => All Programs => DAQFactory Express.
  21. AzeoTech

    Digital output issue

    The AddValue function is not used for writing values to output channels, it is meant for writing values to a channels history. To simply use code to set your output channel use the following: Dout1 = 1 If your output channel is a digital output this will set it to digital output high. If your outut is an analog output it will set it at 1 volt.
  22. AzeoTech

    Array index by time

    You could do this with a little bit of code in a sequence. Var.i = 0 Var.array_length = NumRows(MyChannel) while (Var.i < Var.array_length) Var.strtimestring = FormatDateTime("%H %M %S", MyChannel.Time[Var.i]) if (Var.strtimestring == "22 05 32") Var.index = Var.i break endif Var.i++ endwhile This code assumes data was taken once a second, so that a point was recorded on 22:05:32. Really this code would work better if you are reading your data faster than once a second so that you guarantee a point falling inbetween 22:05:32 and 22:05:33. This code also assumes that the array is static and that no new data is coming into the array at the moment.
  23. AzeoTech

    Just starting

    LabView is a full blown programming language and DAQFactory offers a non-programmable way to interface with your data. If you are not familiar with either program, I would recommend DAQFactory as the learning curve will not be as steep and you should be able to develop what you describe in no time. At the speeds and data rates the U12 offers the limitation is really with the hardware rather than either development zone. One thing to note with the U12 is that while streaming data you cannot execute any other commands without first stopping the stream. For example you mention streaming data while controlling an analog output. Doing this simultaneously with the U12 is not possible. If you are using command / response mode rather than stream then this would be possilbe however you lose speed that the stream mode offers. For more information on data rates see the following link. http://www.labjack.com/lju12datarates.html If you need the speed and the simultaneous control, I would recommend using the UE9 as this is possible with this device. For more on the UE9 see the following link. The UE9 also works just as well with both LabView and DAQFactory. http://www.labjack.com/labjack_ue9.html
  24. AzeoTech

    Synchronising Streams

    There is not going to be a way to get the read and the output to happen at the exact same time, but we should be able to get very close. First off, delete your sequence that includes the read (ADInput) commands as you don't need it. Next, in the Workspace click on your DAOutput channel. Select the Event Tab and paste the following code into the Event page. if (DAOutput[0] != DAOutput[1]) read (ADInput) endif Note that if DAOutput does not have any history, the first time it runs through the above code it will return an alert because DAOutput[1] does not exist yet. To avoid this you could initialize DAOutput to zero before you start the timed sequence. Actually, this should be done anyway or the first time you set DAOutput = 1, DAQFactory does not recognize that it has changed from anything so it will not make a read of ADInput. But if it changes from 0 to 1 then your read will happen. Your other option is to upgrade to a higher version of DAQFactory that does not have the sequence code limitations. The following link will give you more information about higher version. http://www.azeotech.com/dffeaturegrid.php
  25. The following link will direct you to a sample on the Azeotech Knowledgebase that will help you with Burst mode. There is a file there that you can download as well as step-by-step instructions on how it was created. http://www.azeotech.com/faq.php?do=article...e&articleid=160 We have not come across the problem you mention when trying to use burst mode. In all our testing, burst modes works as described. Try out the above sample and see if it works correctly for you or if it also delivers continuous streaming. If the above sample works properly for you, check your burst mode parameters under your command channel and make sure they are properly setup. If you continue to have problems we would be interested in what you are doing to create this problem.