• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Reading SPI data with a T7

    We are looking to add these functions immediately. Please contact us directly and we'll get you a beta. They will probably be added next week.
  2. AzeoTech

    Variable Resolution Index

    Yup, basically what you did, but you need to declare X too. You probably want something like: global resolutionIndex = 11 using("device.LabJack.") include("c:\program files\labjack\drivers\labjackud.h") AddRequest(0,LJ_ioPUT_CONFIG, LJ_chAIN_RESOLUTION, resolutionIndex ,0,0) GoOne(0)
  3. AzeoTech

    Button Visibility

    Yes, but you have to do it in script by changing the button's "visible" property. Give the button a name, then use: component.myButton.visible = 0 to make it invisible, and = 1 to make it visible. Replace 0 and 1 with whatever expression you would like that evaluates to true or false.
  4. AzeoTech

    maximum no of channels

    That actually depends on your remote device and what it's turn-around time is. You should, however, be able to increase the speed by connecting to different TCP devices on different threads so that DAQFactory can communicate with them in parallel. If using Channels the best way to achieve that is to give them different Timing or Offset parameters. So one device might be Timing 1, Offset 0, while another might be at Timing 1, Offset 0.1. They both get read once a second, but in parallel. To figure out your remote device turnaround, use the comm monitor with the time of Tx/Rx display enabled. Note also that you can get better through-put if you make your tags concurrent. In other words, instead of reading registers 1, 3, 7 and 10, try and pack those registers inside the PLC, so 1,2,3 and 4. If you can't pack them, consider reading the in between values in junk channels that you don't use. DAQFactory can read 1, 3, 7, and 10 in either 4 separate queries, if you only specify those channels, or as 1 query if you specify all the registers between 1 and 10 with the same timing and offset.
  5. AzeoTech

    need to show VALUE at plot lines in graph

    If I understand you correctly, you can use the Markers. Right click on the graph near where you want to see the value, and select Marker A or Marker B and Add.
  6. You can't use fromJson() globally. That expects a class type (in the "_ClassName" field) so it can create the class for you. That is more for when you do toJson() to create a json representation of your object, then want to recreate the object. To do it from a raw json file, you need to create a blank class, instantiate it as an object, then call fromJson() on it. Something like this: private handle = file.Open("c:\robbudge.json",1,0,0,0) private string datain = file.Read(handle, file.GetLength(handle)) file.Close(handle) class myClass endclass global xml = new(myClass) xml.fromJson(datain)
  7. I don't know that it has been done, but DAQFactory does have a built in JSON parser, so I would use a tool to convert XML to JSON (I found one in about 3 minutes that was able to convert your file once you remove the first line), then you can write some script to load the json and parse it into a DAQFactory object tree. Then you can just use script to parse through the objects and add channels. Should be pretty easy for someone with scripting experience like yourself.
  8. For a bit, you can use TestBit(). For a group of bits (say D7-D4 of A15), you would have to mask and shift: (value >> 4) & 0x07. This is basic bitwise boolean math that is covered in basic old-school computer science texts if you want to read more.
  9. 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.
  10. 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.
  11. 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])
  12. 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.
  13. AzeoTech


    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.
  14. 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.
  15. AzeoTech

    Current Component Name

    OnPaint is fine, but you still want to use CreateProperty() in OnLoad() to create a local variable to the component.
  16. How much historical data do you have? Does it do it if you just export one channel at a time?
  17. 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.
  18. AzeoTech

    Basic serial communication

    I'd have to see the sequence.
  19. 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.
  20. 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
  21. 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
  22. 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?
  23. AzeoTech


    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
  24. AzeoTech

    Download a Table of data

    Unforunately DAQConnect does not have this feature. You can download data in CSV format, but not PDF.
  25. 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)