PV780 Angel Script

Discuss issues and ideas you have to configuring displays with PowerVision
Dai Uematsu
Posts: 30
Joined: Thu Sep 09, 2010 8:56 pm

PV780 Angel Script

Post by Dai Uematsu » Mon Jul 27, 2015 5:40 am

Our customer is now trying to make a list with container Widget by Angel Script and is facing with some issues as attached. Please review the attached and tell me how to manage these.

Thank you,
Attachments
150727 PV780 Scripting.docx
(50.57 KiB) Downloaded 36 times
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: PV780 Angel Script

Post by stalley » Mon Jul 27, 2015 8:04 am

Hello Dai Uematsu,

There are several topics in this forum about lists and string/text processing. The topic found here viewtopic.php?f=7&t=1033 has a simple demo config using a list and some strings variables.

There is a similar topic here viewtopic.php?f=7&t=1134&p=3110&hilit=list#p3110. It has two demo configs.

There are numerous example configs with lists and display widgets in the Standard and Example Configurations forum here viewforum.php?f=26, look in the PowerVision 2.7 topics.

There are some topics about converting numbers to strings. This topic viewtopic.php?f=7&t=1042&p=2759&hilit=ascii#p2759 is one of the topics and it points to another one.

Hope I have addressed all of the items in your document. If I missed something or you have more questions, I'll be glad to help.
Sara Talley
Software Engineer
Enovation Controls
Dai Uematsu
Posts: 30
Joined: Thu Sep 09, 2010 8:56 pm

Re: PV780 Angel Script

Post by Dai Uematsu » Fri Aug 21, 2015 10:41 am

Dear Sara,

I am sorry for my delay in responding. Would it be possible for you to provide me references or explanations on each item in my initial question file posted at first? I am not familiar with the PowerVision and am not sure which examples and references you provided will help the questions my customer made.

Thank you,
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: PV780 Angel Script

Post by stalley » Mon Aug 24, 2015 10:25 am

Hello Dai Uematsu,

I am attaching a compressed file that includes a configuration specific to the document in your initial post. The document with my comments are also in the attached file.

The comments should point to the specific functions in the scripts that provide examples to assist you and your customers.
DEMO - ReadWriteStrings.zip
(757.99 KiB) Downloaded 28 times
Please let me know if you need continued assistance with this.
Sara Talley
Software Engineer
Enovation Controls
Dai Uematsu
Posts: 30
Joined: Thu Sep 09, 2010 8:56 pm

Re: PV780 Angel Script

Post by Dai Uematsu » Fri Aug 28, 2015 1:00 am

Hello Sara,

Our customer informed me today that they were able to resolve all their issues with the sample configuration you provided. Thank you very much for your support.

Have a good day!

Best regards,
Dai Uematsu
Posts: 30
Joined: Thu Sep 09, 2010 8:56 pm

Re: PV780 Angel Script

Post by Dai Uematsu » Tue Sep 01, 2015 4:39 am

Hello,

I had an additional question from the same customer about the CanInvalid function. They would like to determine if CAN signal is valid/invalid with the function below, but it did not work as expected. The function always returns true(EMG=1). Even when CAN signal is disconnected, no change was made. Please let me know how they can accomplish the behavior they want.

----------
bool CanInvalid( uint variableID )

Returns if a variable can be marked as invalid.
----------



----------
if( CanInvalid(VariableIDs.J1939_IO_01) ){
EMG = 1;
} else {
EMG = 0;
}
----------

Thank you,
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: PV780 Angel Script

Post by stalley » Tue Sep 01, 2015 7:45 am

Hello Dai Uematsu,

If I understand correctly, I would recommend that your customer use the return value from the smRead() function. The help for the smRead() function found on the Function Reference tab explains what the return values are.

In order to get the value stored in VariableIDs.J1939_IO_01, they must read the VariableIDs.J1939_IO_01 into a local variable.

From your example, I assume that EMG is a database variable.

Code: Select all

   double tempVal;
   
   if (smRead(VariableIDs.J1939_IO_01,tempVal))
   		smWrite(VariableIDs.EMG , 1);
   else
   		smWrite(VariableIDs.EMG , 0); 
As you and your customer know, the CAN and MODBus variables have a 5 second delay (default) before they will go invalid. This is configurable and may be changed by the developer.
Sara Talley
Software Engineer
Enovation Controls