Cimplicity export point to CSV

JeandreC

Member
Join Date
Feb 2024
Location
Perth
Posts
4
Good morning,

I have a Emerson/GE PLC with Cimplicity SCADA. I need to export data of a specific point/object to a CSV file and load the CSV file back into the Point/Object. I know about the export function, but I dont want to get all the point in the system, I only need the data of a specific point/Object.

Any idea on how to get this done?
 
There is a PointGet function in the scripting language which returns the value of a point. There is a PointSet function to write a value to a point. There are several file operations available for opening, reading from, writing to files. You define when to call the script in the Event Editor.
 
There is a PointGet function in the scripting language which returns the value of a point. There is a PointSet function to write a value to a point. There are several file operations available for opening, reading from, writing to files. You define when to call the script in the Event Editor.
Here is an example Cimplicity script.
This is getting the value of a virtual point, doing a calculation and setting the result to a PLC register.

Look in the Cimplicity help under Basic Control Engine/Scripting.

Code:
Sub Main()

    'Error Handling Statement
        On Error GoTo ErrorTrap

    'Variables
        Dim MyStationTotalDownTime As New Point: MyStationTotalDownTime.Id = "MyVirtualStationPoint"
        Dim TotalDownTime As New Point: TotalDownTime.Id = "MyStopTime"

        Dim RunBit As New Point: RunBit.Id = "MyRealRunBit"
        Dim MyStationDownPercent As New Point: MyStationDownPercent.Id = "MyRealStationPoint"


    'Get Values
        PointGetMultiple RunBit, MyStationTotalDownTime, TotalDownTime

    'Calculate and Set Values to Real Points
        If ((TotalDownTime.Value(1) <> 0) And (RunBit.QualityIs_Available = TRUE)) Then
            MyStationDownPercent.SetValue = ((MyStationTotalDownTime.Value / TotalDownTime.Value(1)) * 10000)
        End If



    Exit Sub

    'Error Handling Section
        ErrorTrap:
            Resume Next

End Sub
 
I managed to write a scrip to write points to a csv file and also restore back. At the moment the filename is hardcoded.

Is there a way to choose the file from the file open dialog? Normally in VB you would add the fileopendialog element to the form and then you have access to the class to open the dialog and choose the file. However in cimplicity there is no fileopendialog element or am i missing it somewhere?
 
I managed to write a scrip to write points to a csv file and also restore back. At the moment the filename is hardcoded.

Is there a way to choose the file from the file open dialog? Normally in VB you would add the fileopendialog element to the form and then you have access to the class to open the dialog and choose the file. However in cimplicity there is no fileopendialog element or am i missing it somewhere?
Here you go. I use this to open a .csv file to import data to data grid OleObject. The commented part is loading data to Recordset and display in Datagrid. If you don't want use Datagrid, you can also get data from the Recordset.

Sub importDataGrid()

Dim fullFileName As String
fullFileName$ = OpenFilename$("Open File: *.csv ","Documents:*.CSV")

If fullFileName$ <> "" Then
path = FileParse$ (fullFileName$, 2)
fileName = FileParse$ (fullFileName$, 3)

'Dim recordGrid As GefObject
'Set recordGrid = CimGetScreen.Object.Objects.Item("RecordDataGrid").OleObject
'Dim conn As Object
'Dim rs As Object
'Set conn = CreateObject("ADODB.Connection")
'Set rs = CreateObject("ADODB.Recordset")
'conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & path & ";Extended Properties=""Text"""
'openStr = "SELECT * FROM " & fileName
'conn.Open

'rs.Open openStr, conn

'Set recordGrid.ItemsSource = rs
'rs.Close
'conn.Close
End If

End Sub
 

Similar Topics

Is it possible in Cimplicity Version 8.20 to export the alarm classes to a csv file similar to the Clie database export??
Replies
4
Views
3,563
Is it possible to import and export device configurations from cimplicity and how? Also, does anyone have a nicely put together list of...
Replies
1
Views
2,187
We have copied the project folder from one machine to another but it will not run and gives errors. So we need to at least export the tag database...
Replies
3
Views
12,337
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
169
Hello everyone! This is my first time posting, though I have been to this site a few times hunting for some random problem like we all do. I...
Replies
4
Views
173
Back
Top Bottom