Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84249members
353348posts

[Imported] Edit Note Interface

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
sbeadle
Janeway Janeway
Janeway
0 Likes
1
1101

[Imported] Edit Note Interface

>>Message imported from previous forum - Category:Scripts and Tips<<
User: ngh, originally posted: 2019-10-16 04:35:34 Id:561
Hi guys,

Does anybody know how to bring up the edit note interface/method in a script?

I'm after something like:

Set obj = Server.ThisObject
obj.editNote ' This line doesnt work obviously

The best I can do so far is display an object menu with only the edit notes option. But that requires an extra click and annoys me too much.

Thanks!


Accepted Solutions
sbeadle
Janeway Janeway
Janeway
0 Likes
0
1100

Re: [Imported] Edit Note Interface

>>Responses imported from previous forum


Reply From User: geoffpatton, posted: 2019-10-16 17:26:38
Sounds similar to what I once did. On the mimic I have a Text box that shows the notes and then a button that lets the user edit the notes.

Function MaintEdit
Dim MaintNotes, objStationCmd, iMessage
Dim frmEditBox, frmOKButton, frmCancelButton

MaintNotes = Server.GetOPCValue(".Info.NoteTextLong")
Set objStationCmd = Server.FindObject(Server.GetOPCValue(".Info.Fullname"))
If objStationCmd.CheckAccess("CTL") = True Then
'DisplayObjectMenu ".Info", "NoView&NoAlarmView&NoHelpView&NoDefaultView&NoEvents&NoAlarms&NoDisplay&NoQueries&NoTrends&NoMethods&NoErrors&NoRefs&NoProperties&NoEdit&NoLinks&NoNavSync&NoNavSyncTempl&NoUserMethods&NoLocateOPCNavigator"
Form.Init "Display Maint. Log"
Form.AddGroupBox 0,0,110,30,""
Form.AddStaticText 2,2, "Edit Information"
Set frmEditBox = Form.AddEditBox(2,4,100,20)
frmEditBox.MaxLength = 30000
frmEditBox.Value = MaintNotes
frmEditBox.VScroll = True
frmEditBox.SelectText = 0

Set frmOKButton = Form.AddPushButton(2,27,"OK")
frmOKButton.Default = True
Set frmCancelButton = Form.AddPushButton(17,27,"Cancel")
Form.Show

If Form.Selection = "OK" Then
Server.SetOPCValue ".Info.NoteTextLong", frmEditBox.Value
End If
Else
Form.Init "Display Maint. Log"
Form.AddGroupBox 0,0,110,30,"This is not an editable form. To edit the Log, logon as a user with editing rigths."
Form.AddStaticText 2,2, "View Information"
Set frmEditBox = Form.AddEditBox(2,4,100,20)
frmEditBox.MaxLength = 30000
frmEditBox.Value = MaintNotes
frmEditBox.VScroll = True
frmEditBox.ReadOnly = True
frmEditBox.SelectText = 0

Set frmOKButton = Form.AddPushButton(2,27,"OK")
frmOKButton.Default = True
Form.Show
End If
End Function


Reply From User: ngh, posted: 2019-10-16 21:45:24
Thanks geoff! I was hoping to avoid implementing my own edit notes form but I guess that might be my only option.


Reply From User: geoffpatton, posted: 2019-10-18 18:30:05
Yeah, I would have loved something simpler. That was the only thing I could get to work as a one click option.


Reply From User: tfranklin, posted: 2019-10-23 15:55:38
[at]geoffpatton said:
Yeah, I would have loved something simpler. That was the only thing I could get to work as a one click option.

I feel the same way about Control for currentvalue on a point. Using the native Control dialogue for a analog or digital point would be much preferred due to it handling states, limits, and errors already. To control from a custom script pick action menu you'd have to re-write the error handling process with a form rather than something that's just like obj.interface.control and it calls the native control for that object. Obviously we can set the value in script with a single click, but being able to call the native dialogue to allow users to enter a value would be ideal.


Reply From User: geoffpatton, posted: 2019-10-24 13:59:28
[at]tfranklin said:
To control from a custom script pick action menu you'd have to re-write the error handling process with a form

I have done this error checking in script, and it was much more complex. Actually I think the first time I did anything more complex than check for control permissions it was necessary no matter what. I had to write High byte and Low byte for two different settings so I would have had to check the value was valid for the byte and then write the words.

I recycled that code on future forms.

 

See Answer In Context

1 Reply 1
sbeadle
Janeway Janeway
Janeway
0 Likes
0
1101

Re: [Imported] Edit Note Interface

>>Responses imported from previous forum


Reply From User: geoffpatton, posted: 2019-10-16 17:26:38
Sounds similar to what I once did. On the mimic I have a Text box that shows the notes and then a button that lets the user edit the notes.

Function MaintEdit
Dim MaintNotes, objStationCmd, iMessage
Dim frmEditBox, frmOKButton, frmCancelButton

MaintNotes = Server.GetOPCValue(".Info.NoteTextLong")
Set objStationCmd = Server.FindObject(Server.GetOPCValue(".Info.Fullname"))
If objStationCmd.CheckAccess("CTL") = True Then
'DisplayObjectMenu ".Info", "NoView&NoAlarmView&NoHelpView&NoDefaultView&NoEvents&NoAlarms&NoDisplay&NoQueries&NoTrends&NoMethods&NoErrors&NoRefs&NoProperties&NoEdit&NoLinks&NoNavSync&NoNavSyncTempl&NoUserMethods&NoLocateOPCNavigator"
Form.Init "Display Maint. Log"
Form.AddGroupBox 0,0,110,30,""
Form.AddStaticText 2,2, "Edit Information"
Set frmEditBox = Form.AddEditBox(2,4,100,20)
frmEditBox.MaxLength = 30000
frmEditBox.Value = MaintNotes
frmEditBox.VScroll = True
frmEditBox.SelectText = 0

Set frmOKButton = Form.AddPushButton(2,27,"OK")
frmOKButton.Default = True
Set frmCancelButton = Form.AddPushButton(17,27,"Cancel")
Form.Show

If Form.Selection = "OK" Then
Server.SetOPCValue ".Info.NoteTextLong", frmEditBox.Value
End If
Else
Form.Init "Display Maint. Log"
Form.AddGroupBox 0,0,110,30,"This is not an editable form. To edit the Log, logon as a user with editing rigths."
Form.AddStaticText 2,2, "View Information"
Set frmEditBox = Form.AddEditBox(2,4,100,20)
frmEditBox.MaxLength = 30000
frmEditBox.Value = MaintNotes
frmEditBox.VScroll = True
frmEditBox.ReadOnly = True
frmEditBox.SelectText = 0

Set frmOKButton = Form.AddPushButton(2,27,"OK")
frmOKButton.Default = True
Form.Show
End If
End Function


Reply From User: ngh, posted: 2019-10-16 21:45:24
Thanks geoff! I was hoping to avoid implementing my own edit notes form but I guess that might be my only option.


Reply From User: geoffpatton, posted: 2019-10-18 18:30:05
Yeah, I would have loved something simpler. That was the only thing I could get to work as a one click option.


Reply From User: tfranklin, posted: 2019-10-23 15:55:38
[at]geoffpatton said:
Yeah, I would have loved something simpler. That was the only thing I could get to work as a one click option.

I feel the same way about Control for currentvalue on a point. Using the native Control dialogue for a analog or digital point would be much preferred due to it handling states, limits, and errors already. To control from a custom script pick action menu you'd have to re-write the error handling process with a form rather than something that's just like obj.interface.control and it calls the native control for that object. Obviously we can set the value in script with a single click, but being able to call the native dialogue to allow users to enter a value would be ideal.


Reply From User: geoffpatton, posted: 2019-10-24 13:59:28
[at]tfranklin said:
To control from a custom script pick action menu you'd have to re-write the error handling process with a form

I have done this error checking in script, and it was much more complex. Actually I think the first time I did anything more complex than check for control permissions it was necessary no matter what. I had to write High byte and Low byte for two different settings so I would have had to check the value was valid for the byte and then write the words.

I recycled that code on future forms.