AzeoTech

Administrators
  • Content Count

    5,664
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Read from Siemens PLC through profinet protocol

    Or just use an OPC server as I said. DAQFactory is an OPC-DA client so can communicate with OPC-DA servers, of which there are a large variety, including ones for Siemens S7.
  2. AzeoTech

    Read from Siemens PLC through profinet protocol

    Siemens doesn't release their protocol specs without a large payment, so we don't support it natively. In order to talk to this device, you will need to get the appropriate OPC server. I recommend the ones from Software Toolbox. Be warned, OPC servers are pretty pricey, at least compared to DAQFactory licensing costs.
  3. Sure. If you want the average of a channel for all values since midnight it would be: mean(myChannel[0h, 0h+86400-0.001]) 0h returns midnight today. 0h+86400-001 is simply midnight tonight minus 0.001 seconds, which will pick up the entire day no matter what time it currently is. To get yesterday's, just go the other way: mean(myChannel[0h-0.001, 0h-86400])
  4. Yeah, bottom line is that Export and Logging sets are designed for smaller systems with limited flexibility, much like many of the built in features. But when you need more flexibility you can always drop down into script for that part. Channel.ListAll() gives you an array of strings containing the channel names. You can optionally pass in a string with the name of a channel group and get only the channels from that group.
  5. AzeoTech

    Counter

    The folks at LabJack will have to address the shared timer error. That is coming from the device. When I've said don't reset the counter, that is when you are need to continuously count. If you want to read 2.25 revolutions, then change speed, then do it again, and you don't care if you miss counts between cycles, then you certainly can reset the counter. I still find it easier to just record the starting count and subtract it though. Unless of course you expect to roll through 4 billion+ counts. Set Channel is just an old caption from when DAQFactory only had channels. Now you can put variables in there. But I wouldn't use a combo to select a graph type. I'd use buttons and just switch pages to view the different graphs. Or use overlaid pages, similar to how the AshlandWater.ctl sample does it. Combo's are clunky in general and really should only be used when you have too many options to fit on the page for a single click, for example, when selecting what state you live in when you are buying something.
  6. Also, this functionality has been changed in 17.2. We just couldn't figure out the logical reason! For existing applications with components marked center and no color, it will still paint white, but if you create a new component it will only paint a white background if you explicitly give it one.
  7. AzeoTech

    Current Component Name

    OnPaint is fine, but you still want to use CreateProperty() in OnLoad() to create a local variable to the component.
  8. How much historical data do you have? Does it do it if you just export one channel at a time?
  9. AzeoTech

    Bitmap file analysis

    It can be done in 17.2 using the Canvas component. You'll have to contact us for a beta. Here's a clip from the manual: GetPixel(s): These two functions retrieve the pixel values of part of the page. These function will get whatever the pixel color is at the time the component is drawn to the screen, so if other components are underneath this component and haven't been drawn over top of yet, you will get the color from that component. The primary use case for these functions is to capture pixel colors from embedded webcam or other images. Simply place this component on top of the area and use one of the two functions to retrieve the pixels. Then put the result in a global variable for evaluation elsewhere (or evaluate it in the component that evaluation is quick). GetPixel(DC, Point): This returns the RGB color of the pixel at the specified Point. Like the other functions, Point is relative to the top left corner of the page, not the component. GetPixels(DC, Rectangular coord array, [RGB]): This returns the RGB colors of the pixels in the rectangle specified. So, for example, if you do GetPixels(DC, Position), you will get an array with pixel color values for the entire component. The optional RGB parameter is a string which can be either "R", "B" or "G". If you specify this parameter it will only return that particular color component of the pixel. So, GetPixels(DC, Position, "G") will return the green part of pixel under the component. In this case, the result is always 0-255 no matter which color you select. Leaving the RGB parameter blank will get you the full 24 bit color for the pixels.
  10. AzeoTech

    Basic serial communication

    I'd have to see the sequence.
  11. AzeoTech

    Download a Table of data

    #1 - #3: While you can still do it from the dashboard, the better way to do it is using the DownloadData() function. The docs for that are below. #4: DAQConnect supports the ability to replicate your data to a MySQL database that is externally accessible. You could then use pretty much any web based reporting tool available to generate reports, or do data mining. The MySQL feature requires an OEM server and so we would have to migrate your account over to an OEM. Please email us directly to discuss. Data download docs: $.dc.dataSource.downloadData(data source name, options) Options can be a whole bunch of stuff, but if you leave it empty and just do, for example: $.dc.dataSource.downloadData("DataSourceName") it will prompt the user for many of the items, including which tags to download. Options is a javascript object, with these defaults: { filename : dataSourceName + "_data.csv", columns : [], tags : [], tagsToDisplay : null, start : $.dc.member.getCurrentServerTime() - 86400000, end : $.dc.member.getCurrentServerTime(), format : "csv", interval : 60000, ignoreEmpty : true, promptMember : true, tzOffset : 0 }; Probably a little confusing. First an example, let's say you want to display a different default file name and interval: $.dc.dataSource.downloadData("Belleville", {filename : "myfile.csv", interval : 120000}) Here's a description: filename: the default file name displayed, or the actual final file name if promptMember is false columns: an array specifying exactly what to download. Should only be used if promptMember is false. Takes an array of objects in the form: {tag : "xxx", label : "yyy"}. Use this when you want to create a button that downloads the same set of tags every time and you don't want to ask the user. Using this is a nice replacement for a dataset tags: an array of string specifying the tags to download. This is just a slimmer version of columns. Use one or the other. Using columns gives you control over labels. This uses the tag name as the label. tagsToDisplay: an array of strings listing (case sensitive) the tags you'd like the user to see when the popup arrives. Leave null to list all tags in the data source start/end: the start and end of the time range to download, in ms. Defaults to the last day. format: presently always "csv" interval: the spacing of the data, in milliseconds. Defaults to 60 seconds. ignoreEmpty: if true, then a row is only created if there is data in one of the columns. If false, then a row is created at every interval between start and end promptMember: if true, then a popup asking for the tags, range, interval, etc is displayed. Otherwise it uses the above settings. Make sure tags or columns is specified if this is false. Make sure they aren't specified if true. tzOffset : time zone offset in hours from UTC. Can be fractional hours. Affects start/end time as well.
  12. AzeoTech

    Formula Using A Tag - How To Do It

    DAQFactory or DAQConnect? I'm assuming you mean DAQFactory, where as the rest of this post is about DAQConnect. In DAQConnect, it is math.pow() as DAQConnect runs in JavaScript. DAQFactory scripting is completely different, and much similar. To do 4 raised the third power, you would just do: V.aa = 4 ^ 3
  13. AzeoTech

    Evaluate syntax

    The Set To action can only take a channel or variable. Think of it like the left side of an assignment: myChannel = 5 You can't do: sin(myChannel) = 5 and Evaluate() is a function just like sin(). To do what you want, you'll have to use a Quick Sequence and execute. Something like: private string datain = system.entryDialog("Enter a value:") if (!isempty(datain)) execute(sites[site_ID[0]] + "_Tank_Install_Height[0] = datain") endif
  14. Unfortunately you didn't quite catch the timeout error at 19:36:31. But I do see that occasionally your device takes 200ms or more to reply to a query from DAQFactory. That seems long, especially since other times it's closer to 60-80ms (which is also pretty long for ethernet). Are you going over a radio?
  15. AzeoTech

    BARCODE READER

    That depends a little on the output of the scanner, but in general the scanners send the scanned value plus a carriage return. So you would do something like this for a numeric scan: device.myDevice.purge() private string datain while(1) try datain = device.myDevice.readUntil(13) myChannel.addValue(strToDouble(datain)) catch() // ignore timeout errors as scans are intermittant endcatch delay(0.1) endwhile
  16. AzeoTech

    Download a Table of data

    Unforunately DAQConnect does not have this feature. You can download data in CSV format, but not PDF.
  17. AzeoTech

    Limit decimals

    Depends on where you are doing it. If you are simply using a variable value component, you can use the Precision parameter and it will display just that many decimals. Elsewhere, you can use the format() function to format the data however you like. Format() works just like the printf() function in C / C++ which has been around a long time. There are many examples on the web, or in the DAQFactory User's guide. But for example, if you have a variable "DailyPlantFactor" that you want to format to 2 decimals, you would do: format("%.2f", DailyPlantFactor)
  18. AzeoTech

    Nested If & while statements

    I would move the file writing part to a separate sequence function: function writeLine() FileHandle = File.Open(NewFileName,0,1,1,1) private string out= ChannelData File.Write(FileHandle,out) File.Close(FileHandle) Then call it where you need it in your loops. That way you can do your step check inside the inner loop and also log outside the loop. BTW: watch your indentation. 3 spaces in for every block (while, if, etc), and 3 spaces out for end of block (endwhile, endif, etc.)
  19. AzeoTech

    Evaluate syntax

    That's because max() returns a number not a string and evaluate expects a string. You either want the max outside the evaluate, or inside a string, so either: max(evaluate(sites[....) or: evaluate("max(" + sites[...)
  20. AzeoTech

    BARCODE READER

    You'll use the NULL protocol, then write a little script to read from the serial port and process the input.
  21. AzeoTech

    Channel not plotting

    You aren't assigning the proper time. You want the second parameter to be: Pump_Inlet_Pressure_Bar.time[0] otherwise you are assigning the value of that channel as the time, which is likely giving you dates around 1970.
  22. AzeoTech

    Alarm Reset slow

    For one thing, I think you want: alarmreset == 0 And I think you have the mouse down check part reversed. It should be 1 on mouse up, and 0 on mouse down so that alarmreset is 0 only momentarily. I however, would probably reverse the logic all round and make the reset condition be: alarmreset == 1 (or just: alarmreset) and then keep the button the way you have it.
  23. It does, but I'd use longer variable names. I general reserve single letter variable names for counters in things like for() loops. I also probably wouldn't do the separate assignment for each item. I'd definitely shorten crlf, your <td>, and deg, though I'd rename "a" to at least "td" so its clear, then I'd leave the rest, so instead of: out += crlf + a + m + deg I'd put: out += crlf + td + format("%3.1f",Temp1[0]) + deg Its much clearer and you don't have to constantly scroll up your code to figure out what m, o, and p are. There just isn't a good reason to assign them to a variable even if the variable name is more than 1 letter.
  24. You want to put that code in the Event for COMPONENT_TYPE so that it gets executed whenever component_type changes. The visibility option for the edit box needs to be an expression, so as an alternative to the if() statement in the Event, you could just put this: COMPONENT_TYPE[0] == "desired_component" in the Visible expression. Whenever you see "Expression" you should think a "formula" that returns a value. In this case, if the value it returns is non-zero, it is true and the component is visible. If it is 0, it is not visible. Also note that you need to use == for comparison. A single = is assignment. Of course the Event version gives you the ability to then do other stuff depending on what component_type is selected.