Proficy machine edition logging

891 views

Published on

Logging scenarios and setup in Proficy Machine edition View

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
891
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Select: Start---settings---control panel---administrative tools
  • Select Data sources (ODBC)
  • We need to add our own DSN Data Source Name
  • Now we need to to specify the driver that will be used to obtain the data from the source and pass it to the database
  • Now specify the DSN and select Create. I have called it MyLog and have put in a description in case I need to create some more connections
  • This will bring up an input box where we will name the database file “myaccessfile” is this one click ok
  • We get confirmation that we now have an MS Access database file that will be supplied with data through our connection (DSN) MYlog
  • The way in which we get data from our project to the MS Access database is to use a script command “dbconnect” which connects to the ODBC source (MyLog). Select how the script runs, here it’s on condition that the bool variable ODBC comes on momentarily
  • You can only call SQL commands after having a connection. Here dbSQL INSERT into puts values into the database table the syntax is most important and is shown in detail in the help file. Here the variable odbc will will be placed into a column named “odbc” if the column isn’t found data won’t be logged.
  • We need to put in a script to close our connection
  • We will put a button on our panel to start MS Access. A momentary button that has the Appexec command will achieve this.
  • We must download for the scripts to take effect
  • Locate your database file “ Myaccessfile” be aware that there can be problems with the path of these files. Path names with spaces in the route sometimes will not work ie “documents and settings” We need to change the header names from field 6 etc to the names written in our logging script
  • Save the changes
  • Keep it simple and maybe accept table1
  • MS Access will prompt for a key which is a good way to follow your data
  • Finally check the table has the correct header names and close Access
  • We have a button on our screen that runs the dbconnect script
  • We had a message box programmed in our script to come up if we connected or not
  • We added a button to our screen to launch MS Access
  • Hopefully you will now have access open and data showing the data does not update live but will keep logging in the background and will show when the table is re-opened
  • Proficy machine edition logging

    1. 1. In Control Panel Select Admin Tools
    2. 2. Select Data Sources
    3. 3. ADD new system DSN
    4. 4. We will use the MS Access Driver
    5. 5. Enter a DSN eg: “MyLog” and then select“Create” Keep a note of the Data Source Name you use as you will need to use this exact name to connect through your scripting
    6. 6. Enter a filename you will need to remember this to use it in your Start MS Access script and also to configure the Table within it.
    7. 8. Create this script. Run it “on condtion” and “when true” by placing a button on the screen which has “touch animation” with an internal variable eg:ODBC, which is set as “momentary” you will be able to connect to your data source “MyLog”
    8. 9. This scripts logs data through the connected DSN The syntax must be correct. Try one variable first just to get it working Run Periodically at 1000mS
    9. 10. This disconnects from the DSN
    10. 11. Create this script. Run it “on condtion” and “when true” by placing a button on the screen which has “touch animation” with an internal variable eg:access, which is set as “momentary” you will be able to start MS Access The Path to MSAccess.exe must be as written in your script which may differ from above
    11. 12. Don’t forget to download the Project
    12. 13. Open the database file you created eg “Myaccessfile.mdb” Doubleclick on the column headers to change them to match your logging script
    13. 14. Click SAVE
    14. 16. Accept ,”YES”
    15. 17. Select Table1 as per you logging script to check the table is ok
    16. 18. Close MS Access
    17. 19. Start runtime and click on your button to run the connect script
    18. 21. Click on your button to run the MSaccess script
    19. 22. You should have logged data

    ×