AzeoTech

Administrators
  • Content Count

    5,868
  • Joined

  • Last visited

Community Reputation

0 Neutral

2 Followers

About AzeoTech

  • Rank
    Guru

Recent Profile Visitors

51,047 profile views
  1. AzeoTech

    ODBC Database alarm logging

    It posts the time in Excel time format, meaning as a number that is decimal days since 1900. This is what worked on the databases we tested when this was first added, but obviously appears to not always work. You have two options: 1) change "TheTime" to a floating point instead of date. Then it should post correctly, but of course then the time stamp will be a number instead of something human readable. You also might try setting TheTime to datetime instead of just date. 2) log alarms yourself using the alarm events and a sequence function to do the logging and db. functions. This will allow you to log however you want. The only challenge is that you have to go through all of your alarms and add a line of script for each of the 3 events you want to log.
  2. AzeoTech

    Enable/ disable modbus Device

    First, a Modbus device that has is not connecting should not affect the data coming from other devices. If it is, then you have other issues, probably related to Modbus IDs (are you using 0 or 255?). Timeouts will affect other devices on the same Timing interval of the channels, but won't affect the actual number received from working devices, just how often it is able to poll. This you can fix by putting each device on a different Timing / Offset setting. But that only really works if each device is on its own serial port, or Ethernet IP. If you are doing multidrop, then you are limited. That all said, you can use the SetBypass() function to essentially disable a particular device, or a particular id on a device. This is described in detail in 6.13 of the user's guide. It can be used to disable a device, or to create a simulation when you are offline. But, do take the time to figure out why one device's status affects the data being received by another device. Simply bypassing the offending device is chasing the symptom and not the cure. Once you figure this out, then you can implement the bypass to make your system run more efficiently.
  3. AzeoTech

    LabJack and mpu6050

    Matlab files aren't going to run in DAQFactory. For DAQFactory and the U3 you should review the DAQFactory - LabJack Application guide that is installed with DAQFactory. The script will be similar to Matlab but not identical.
  4. AzeoTech

    On Send Protocol Help

    You'll want to use the LockPort() and UnlockPort() functions to prevent the sort of overlap you described. It should be something like: try if (!LockPort()) throw("Couldn't lock port") endif // do comms UnlockPort() catch() UnlockPort() throw() endcatch But note that the way you are writing your script really doesn't justify using a User protocol. You are hardcoding all the specs, even the port connection, so the channel configuration doesn't matter, and reuse will be hard. You are just using the channel as a trigger. You would probably be better off just writing sequences. It will be much easier to debug. You still might have to lock the port if you use multiple threads.
  5. I think I'm confused. So DAQFactory is the Modbus slave? Ah, so the issue is that you can't update the channels so that Wonderware gets them all at the same time. You may have to use a flag to tell Wonderware when to read the channels. Set the flag to 0 to tell Wonderware to stop looking, update the channels, then set it back to 1. Are you on serial or Ethernet? That will make a big difference.
  6. That works! If it is written in unmanaged code, you could also wrap it in a DLL and then use extern() to load it in as a function callable from DAQFactory script.
  7. Normally you could use file.filesaveDialog(), but that would allow one to view the entire harddrive. Really you are going to have to simply ask them directly what the drive letter is as DAQFactory doesn't have a way to just browse folders. There is a FolderSelectDialog() function in the next release which should do the job. Email us if you'd like to try a pre-release. Once you have the source and destination you can just use file.copy().
  8. Use the OnLoad event of a component on your first page to call the sequence as a function instead of running it in the background. OnLoad only gets called once, so should do the job.
  9. AzeoTech

    Timer Control

    There are a number of ways to do this depending on the details of your desired logic. Probably the most reliable is to have a global variable that indicates the desired pump state (on/off), then have a sequence that monitors this and the solenoids and acts accordingly. The button would change the global, not the pump directly. Here's the code, assuming you have created and initialized a variable called "APumpHOA" and your digital channels are Up, Down and APump. I'm going to make APumpHOA a Hand, Off, Auto switch. You can just use the off and Auto for off and on if you don't want a Hand state (force on). APumpHOA = 0 is off, 1 is hand (force on) and 2 is auto. This sequence should always be running: private autoOffStartTime = 0 while(1) switch case(APumpHOA == 0) // off APump = 0 case (APumpHOA == 1) // hand (force on) APump = 1 case (APumpHOA == 2) // auto if (autoOffStartTime == 0) // not in "off" mode if ((sum(Up[systime(),systime()-60]) == 0) && (sum(Down[systime(),systime()-60]) == 0)) // both pumps off for the last minute autoOffStartTime = systime() aPump = 0 else aPump = 1 endif else if (Up[0] || Down[0]) // one of the solenoids came on, so reset autoOffStartTime = 0 aPump = 1 else aPump = (systime() - autoOffStartTime > 60) endif endif endcase delay(0.1) endwhile That should be about it, though of course I can't test. Note that after 60 seconds, the pump will start back up, and stay running even if both solenoids remain off.
  10. I would need to see your actual .ctl document. My first guess is that you have a channel with Timing, but I would have to see the whole doc to confirm.
  11. This is because you declared global variables with the same name as your output channels. Both channel names and global variables have global scope, but in the case of conflict, the global variable takes precedence. Note that once a global is declared, the only way to undeclare it is to call ClearGlobals(), which will undeclare all your globals. Or restart after removing the declaration in startup... It is probably easier to simply rename the channels.
  12. AzeoTech

    Unable to open ODBC MySQL

    They are the same because you are putting the two different results into the same global variable, dht11_logs. You need to use a separate variable for each. Also they do not need to be strings, and would be better if not.
  13. AzeoTech

    Unable to open ODBC MySQL

    I'm sorry, but you aren't really giving me enough information to help. I need to know the name of the ODBC data source, the name of the table, and the structure of the table. Is "content" a field in the table? My guess is that line 23 should be datain.temperature, but I can't tell without knowing more detail. Also, pretty much always put: ? strLastError inside of a catch() so you know exactly where the error is. Just putting ? "fail to connect" doesn't tell you which line it had a problem with. My guess is that it is line 23, since you got through the first four lines of script outside the try/catch without error. Also: you only need to open the database once. Do it in a startup sequence, making "dbase" into a global. Opening it multiple times without closing will eventually use up all the available handles.
  14. AzeoTech

    Adding vertical lines in a diagram

    You'll want a line annotation. Set it to the X axis and make sure the expression results in an array of time stamps, one element for each event you want marked.
  15. AzeoTech

    Unable to open ODBC MySQL

    Is arduino also the name of your table? I suggest naming everything different, i.e. use one name for your ODBC data source name, another for the database name, and another for your any tables. Then it won't get confusing. In general, if queries don't work, I usually suggest going into the database's prompt and trying it manually through their SQL tool. But in your case, the issue almost certainly is the table name since it is a very simple query.