AzeoTech

Administrators
  • Content Count

    5,729
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. Don't make "dec" private. Private means the variable is only available inside that script. Instead either make it global, or create a Test D/A channel and set that with the result: myChannel = evaluate("0x" + hex)
  2. You didn't follow my example. You don't want http:// in the URL, nor the closing /. It should be just like what I showed, with the IP address alone as the first string parameter, and the path as the second one.
  3. You can't do it with one component without scripting. It would be easiest to just use two components, a variable value one for the number, and then a Symbol component for the background. Then move the symbol component behind the variable value one. The symbol component works even if you don't have any symbols, provided you have colors specified.
  4. You can use HTTP.Get() to retrieve the output and store it in a string: private string in = HTTP.Get("192.168.1.250", "iolinkmaster/port[4]/iolinkdevice/pdin/getdata") Then I'd just use find() to figure out where it says "value", then get that value. Once you have the hex value as a string, you can prepend 0x in front and use evaluate: private string hex = "00D1FF00" private dec = evaluate("0x" + hex)
  5. AzeoTech

    Remote Daq Connection fail

    You might need to contact us directly so I can remote into your system and see what is going on.
  6. AzeoTech

    Remote Daq Connection fail

    I'd try it without passwords first. The passwords determine the encryption so if that was wrong you'd get invalid packets.
  7. AzeoTech

    Remote Daq Connection fail

    You are getting invalid packets? Are both systems running the same release of DAQFactory? Did you put any sort of password on the connections? Have you tried using script to reset the connection if it fails?
  8. AzeoTech

    DAQ 18.1 licensing

    The two versions issue you can eliminate by going to File - Preferences and selecting "Disable 2nd instance check", though truthfully I thought we eliminated the whole 2nd instance check in 18.1. It has nothing to do with SmartScreen. It is starting in Development mode because there is a development license. You can force it into Runtime by going to File - Document settings and entering a document editing password. This will cause it to start in Runtime and require a password to switch the document into development mode. Make sure you remember the password! Yes, you could install 17 and 18 concurrently. The easy way is to install 18, then rename DAQFactory.exe to, say, DAQFactory_181.exe, then install 17.1, which will create a new DAQFactory.exe Then run one of each. I do this all the time and have several releases of DAQFactory on my workstation.
  9. AzeoTech

    Odd issue comparing two numbers

    OK, this is actually a feature of floating point numbers in computers and has nothing to do specifically with DAQFactory. The short of it is that while computers store integers exactly, the decimal part (right of the decimal place) is almost never stored exactly due to the way floating point values work. DAQFactory uses double precision floating point so the effect is smaller than single precision, but it still means that 0.1, for example, is probably stored as 0.0999999999999998 or something like that. When DAQFactory goes to display the value it shows as 0.1 because of various algorithms to clean up floating values, but internally it is actually slightly off from 0.1. You actually rarely see this problem because the system does some automatic rounding, except for when you do something like what you did where you added a bunch of fractional values together and then compared it to a value that was directly entered. The slight offset of 1/2000 is getting compounded so that by the time it is 0.054 it is actually slightly different. Alas, there is no real easy way to see this. However, try replacing your ? n[100] with: ? n[100]// output is 0.054 ? n[100] == 0.054 ? n[100] < 0.054001 ? n[100] > 0.053999 ? floor(n[100] * 1000) / 1000 == 0.054 What you'll see is: 0.054 0 1 1 1 The 0 is the comparison you did and doesn't compute because n[100] is actually slightly off from 0.054. The next two show that it is just slightly off, and the last one shows how you can simply truncate anything after the 3rd decimal place and do the comparison and it works.
  10. That's because you already declared pingIPs as a number. Declaring a global variable after it is already declared doesn't change the type. You need to either save and restart, or enter ClearGlobals() at the command / alert window to clear out all existing globals so that pingIPs can be redeclared as a string. I recommend the restart option so your auto-start sequence runs (if any) otherwise you end up with other problems (other global variables that have now been "undeclared")
  11. Sometimes it can be hard to tell if a failure to communicate with a device is caused by a networking issue (cut cable, no power to remote device) or something else (protocol error, etc.) In these cases, the first thing we tend to do is ping the device. A successful ping at least tells us that the device is powered up and the IP is accessible from this computer. It doesn't tell us if the device will allow us to connect to it, a firewall is blocking the desired ports (say 502 for Modbus), or other issues, but it does eliminate some possible problems. There are many times when we wish to do this automatically. So, here is a simple script we'd like to share that you can use to ping a device from script: function checkPing(string ip, string path) system.ShellExecute("cmd","","/C ping " + ip + " > " + path, "", "hide") delay(5) private h = file.Open(path,1,0,0,0) private string data = file.Read(h, file.GetLength(h)) file.Close(h) return(find(data,"TTL=",0) != -1) It does this by triggering the command line ping, just like you would type it, and then piping the result to a file. Then it opens the file and looks for "TTL=" which really only appears if a ping is successful. The delay(5) is to give the ping command time to execute as there is no way us to know. ShellExecute() is a non-blocking function, meaning it will trigger the command but then immediately return. Because we are using command line piping we have to have shellExecute() run "CMD" not "Ping" directly. We pass the /C flag to CMD to tell it to run the Ping command then quit. The design of this function is to allow you to, in script, check the network status on many devices. Simply call this function with the ip and a path to the file you'd like ping to create with the result. You'll want to make sure if you are calling this function from multiple threads for multiple IPs that you pass a different path. Note also that this function will take at least 5 seconds to run, so don't call it from the command line or a button press. Make sure and call it from a sequence running in a background thread.
  12. Right. Sorry didn't look carefully and missed your typo. Look in the calling function. You have pingIPs declared as a number, not a string. You then define it as an array of strings, but the variable is still declared as a number, so DAQFactory is converting all it to an array of 192.168's and the rest is thrown away because it is not a valid number. DAQFactory will convert string numbers to actual numbers up to the point where it is invalid, or if the first character is invalid it will convert it to NaN. So, "192.168.141.50" becomes 192.168, and "ab192" becomes NaN, and "192ab" becomes 192. If you go to a command prompt and type: ping 192.168 you'll see that it will actually try and ping 192.0.0.168. That's being done by the ping executable.
  13. OK, is there an issue? One thing I will point out is that in newer releases of DAQFactory, the C:\DAQFactory installation folder is read-only when DAQFactory is run in normal mode. This is for security reasons. That means that your code might not be able to write the text to D:\DAQFactory\probe2. Check the security settings on the folder, or better yet, create a new folder for this file.
  14. 192.0.0.168 is an unusual IP address. Usually local addresses start with 192.168, so maybe 192.168.0.1?
  15. AzeoTech

    DAQ 18.1 licensing

    I'm not sure about using an 18.1 doc on 17.1. Usually this won't work. As for 18.1 the issues aren't with the app itself but with the installer. We had to renew our code signing certificate, which in turn now triggers Windows Smart Screen because, a different cert means that Microsoft thinks it is new software despite DAQFactory being available for a good 18 years. We will thus be updating the download site to allow for 17.1 and 18.1, but 18.1 will have the warning that SmartScreen may appear and challenge the install. This will go away with time, once Microsoft figures it out, but we don't want to scare new users with a SmartScreen display. Until that time, you can get the 18.1 download by copying the 17.1 link and simply changing the 17 to an 18 in the link.
  16. Yes, but it will come back. We had to renew our code signing certificate, which in turn now triggers Windows Smart Screen because, a different cert means that Microsoft thinks it is new software despite DAQFactory being available for a good 18 years. We will thus be updating the download site to allow for 17.1 and 18.1, but 18.1 will have the warning that SmartScreen may appear and challenge the install. This will go away with time, once Microsoft figures it out, but we don't want to scare new users with a SmartScreen display. Until that time, you can get the 18.1 download by copying the 17.1 link and simply changing the 17 to an 18 in the link. I should add that except for this silly SmartScreen issue, 18.1 is fine to use.
  17. AzeoTech

    Logging.mylog.Exceltime ??

    This variable was changed to "TimeFormat". Set to 0 to use a configuration string, 1 for excel time, and 2 for regular DAQFactory time. The configuration string can be changed via code using the "TimeFormatting" variable. Both of these are also configurable through the regular logging properties.
  18. Yes you do, and they need to be non-zero (as zero is the "First Found" in DAQFactory). The actual assignment has to be done in Kipling. Then just put the desired ID in the D# column of the channel. For the T7 over Ethernet you would not need to do this and can simply specify the IP address of the T7 in the D# column.
  19. AzeoTech

    Alarm table filter

    Use the Filter() function. That will allow you to filter the arrays based on a criteria. That said, you might consider splitting it by group as they are generated into two different arrays.
  20. AzeoTech

    Date time component

    That's what the global variables are for. Create a sequence marked Auto - Start that declares and initializes those variables: global startTime = systime() global endTime = systime() Then have the date/time controls edit those two variables. Finally, add a button that parses the values and sends to the device as I described.
  21. AzeoTech

    Date time component

    OK, are you sure it is 32 bit? Doesn't matter, but seems excessive since each value is well below the 16 bit limit. Anyhow, you'll have to create a global variable that contains the start time and one for the end time. Then have the user interface elements edit those variables. You'll need a button to trigger some script that updates the schedule times in the PLC. That script could be done in a number of ways, but probably the easiest is to use formatDateTime() [see section 4.12.11 of user's guide] to get the date/time number into a comma delimited string: private string x = formatDateTime("%Y,%m,%d,%H,%M,%S", starttimevariable) then use parse() on that string to get each value: private out = parse(x, -1, ",") which will return an array of those 6 values which you can then send to your Modbus device.
  22. AzeoTech

    Date time component

    In 6 different registers?
  23. AzeoTech

    Date time component

    Well, the trick is first determining what format your device expects the date and time. You definitely can't just tell it January 15th 2020. It won't understand that, and Modbus doesn't support sending that sort of information anyway. Usually date and time is stored internally in computers as some sort of number referenced to an epoch. For example, DAQFactory stores date/time information as seconds since Jan 1, 1970 (standard Unix time format), while Excel uses decimal days since 1900. These are very different, as today we are at about 1.57 billion seconds since 1970, but only about 44,000 days since 1900. Anyhow, you'll need to find what your device expects then I can describe how to get there.
  24. AzeoTech

    Emotron floating point format & Modbus

    I'm afraid it would take a bit of experimentation so you are on your own. But yes, if the value is less than or equal to 32767 you can just treat it as an integer and use it as is. If it is > 32767 then you have to do the conversion.
  25. Can you post a sample of what you have so I can see what might be wrong?