Switch to desktop version  

Ewon TechForum
Providing technical solutions to technical requests


  [Update] SetTagValue() and ONCHANGE?
Posted by: mickaa - 18-06-2025, 05:22 PM - No Replies

Hi,

- When I call my function @SetTagValue("Sensor1Temperature",@EpochTimeString$()) everything works fine.
But when I call ONCHANGE "Sensor1Temperature", '@SetTagValue("Sensor1Time",@EpochTimeString$())' the script stops at the "@SetTagValue()" function when it is called by ONCHANGE.

Can someone clarify this problem for me?




Code:
REM In init section
ONCHANGE "Sensor1Temperature", '@SetTagValue("Sensor1Time",@EpochTimeString$())'
TSET 2, 5
ONTIMER 2, "@GenerateData2()"


Code:
FUNCTION GenerateData2()
  MY_FONCTION$="GenerateData2"
  TSET 2,0
  @MyLogEvent(MY_FONCTION$,"==== GenerateData ====",120)
  @SetTagValue("Sensor1Temperature", "40.00")
  TSET 2,20
ENDFN


Code:
FUNCTION SetTagValue($MyTag$, $ValueString$)
  MY_FONCTION$="SetTagValue"
 
  // @CheckTagExist($MyTag$)
 
  SETSYS TAG, "LOAD", $MyTag$
  $MyTagType$=GETSYS TAG, "Type"
 
  IF VAL($MyTagType$)=TYPE_BOOL% THEN
    $MyTagValueBool%=VAL($ValueString$)
    SETIO $MyTag$, $MyTagValueBool%
  ELSE
    IF VAL($MyTagType$)=TYPE_FLOAT% THEN
      $MyTagValueFloat=VAL($ValueString$)
      SETIO $MyTag$, $MyTagValueFloat
    ELSE
      IF VAL($MyTagType$)=TYPE_INT% THEN
        $MyTagValueInt%=VAL($ValueString$)
        SETIO $MyTag$, $MyTagValueInt% 
      ELSE 
        IF VAL($MyTagType$)=TYPE_STRING% THEN
          SETIO $MyTag$, $ValueString$
        ELSE
          @MyLogEvent(MY_FONCTION$,"{ERROR} Tag Type not recognized. [$MyTag$:"+$MyTag$+"] | [$ValueString$:"+$ValueString$+"]",90)
        ENDIF
      ENDIF
    ENDIF
  ENDIF
ENDFN

Continue reading..

  Issue with Duplicate Data in Shift-End HTML Reports via Ewon Flexy 205
Posted by: shailendra - 13-06-2025, 06:37 AM - Replies (1)

Dear Sir,
I am writing to you regarding a persistent problem with the HTML reports generated by the Ewon Flexy 205 module (S.NO. 2317-1661-24) for Shift A and Shift B.
Currently, at the end of each shift, the system captures data and sends it as an HTML report via email. However, we are encountering an issue where the reports contain double entries of the data instead of a single entry per shift. This results in duplicate information in the reports.
I have already attempted to resolve this, including implementing the settings you previously suggested, but the problem continues.
Could you please provide assistance in configuring the system to ensure that only a single data entry is captured at the end of each shift, thus eliminating the duplication?

I have attached relevant images and the HTML reports for your review.



Attached Files Thumbnail(s)
   

  SHIFTB 1.HTML (Size: 534 bytes / Downloads: 2)
Continue reading..

  Default Event Handler
Posted by: ZillKhan - 11-06-2025, 02:44 PM - No Replies

Hello,
I wanted to ask, do you have any specific events that are already defined in default event handler or can we define a custom event handler of our own too?
As mentioned in the Java interface documentation:
" As you can see a “listener” is an instance of a “listener” class, this “listener” class derive from the EvtListenerBase object and defines the callEvent function, this function will be called when the runEventHandler will detect the specific type of event"

Continue reading..

  Syncdata and duplicate data points
Posted by: erniek - 04-06-2025, 04:35 PM - No Replies

Hi , my IT guys are using the syncdata with transaction id to periodically query new data from a number of ewons sharing the same data pool.

They are receiving (at times) new and previous data points on request, which is causing duplicate data records in the client database.

Is the transaction id (that is returned) unique/tracked by means of the t2mdevid and t2mtoken parameters ?  

Is there something we missing to ensure we only get new data with each syncdata call.

Has anyone had a similar problem ?


Regards
Ernie

Continue reading..

  RuntimeControl.refreshWatchdog() understanding
Posted by: ZillKhan - 02-06-2025, 01:45 PM - Replies (1)

Hello,
I want to understand the working of RuntimeControl.refreshWatchdog();
I am using Java to program eWON for my application.
In my Java client application I set the watchdog timeout using this:
RuntimeControl.configureAppWatchdog(60000); // timeout set to 60sec - assuming its timeout is in milisecond

Then, in my application while loop, I run this every 30 seconds.
[font=Consolas, 'Courier New', monospace]if (currentTime - startTime >= RESTART_TIME_THRESHOLD) {
                Log.info("Refreshing Watchdog timer!");
                RuntimeControl.refreshWatchdog();
                startTime = currentTime;
            }
[/font]


Can you please confirm it's working and also provide any reference documentation for looking into this API in detail.


Continue reading..

  Omron FINS I/O Server
Posted by: BrooksyB1 - 27-05-2025, 02:08 PM - No Replies

Hello,

I am about to setup Tags in a Flexy 205 to retrieve data from an Omron NX1P2 over ethernet.
Are there any documents or forums that will help me achieve this?
I need to display Bools, INT & REAL values from the Omron NX1P2 as Tags in the Flexy.
I believe both FINS TCP & UDP can be used, is there any advantage of disadvantage of using one over the other?

I have done a search here for Omron FINS, but could not seem to find much detail in how to go about this procedure.

Thank you
David.

Continue reading..

  OPCUA Connection issues
Posted by: alo_dafo - 27-05-2025, 07:46 AM - No Replies

Good morning all,

I have a customer that tries to connect to the eWON OPCUA Server from their .NET application OPCFoundation.NetStandard.Opc.Ua library.

They have set the certificate to trusted in the eWON and can connect successfully via uaExpert, but not with their application.

Error message in their application is BadUserAccessDenied.

The event log in the eWON shows
-28611 secu-Authentication failure (From OPCUA server, localhost)

The connect via WAN port (WANItfProt = 2 Allow all), same way as with uaExpert.

• Endpoint #4: SecurityPolicy=Basic256Sha256, SecurityMode=SignAndEncrypt
• UserTokenType=UserName, SecurityPolicy=Basic256 (as published by the server)
• Password encrypted using:
• Algorithm: http://www.w3.org/2001/04/xmlenc#rsa-oaep
• Padding: RSA-OAEP with SHA1
• Server's public certificate (thumbprint verified)
• PolicyId = "UserName" (case-sensitive and validated)

Continue reading..

  Is possible turn on/off "Historical data" using Basic code?
Posted by: LuisEnrique - 26-05-2025, 07:41 PM - Replies (3)

Hi team HMS

I would like turn on/off the "Historical data" using Basic code, it is possible to do this?

Thanks in advance.

Luis

Continue reading..

  PUTFTP not terminating
Posted by: pem199 - 16-05-2025, 02:47 PM - Replies (1)

Hello all,

So i have a problem with the PUTFTP function,

I'm trying to put a file on the server hosted by my laptop.
I created the server with Filezilla. Disabled the SSL requirement etc.

I'm using the following script for the put ftp function:

Rem --- eWON start section: Init Section
eWON_init_section:
Rem --- eWON user (start)
Tset 1, 10
OnTimer 1, "goto sendFTP"
Rem --- eWON user (end)
End
Rem --- eWON end section: Init Section
Rem --- eWON start section: SendFTP
Rem --- eWON user (start)
sendFTP:
  // Post a file containing a custom text
  a$ = "/MyFile.txt"
  b$ = "this is the text of the file"
  c$ = "xxx:xxx@xxx.xxx.xxx.xxx:21,1"
  PUTFTP a$, b$, c$
 
End

On the filezilla side i can see connections being made (but not closed?). However the file never ends up in the FTP. 
And when i check "Scheduled Actions" on the Ewon i can see actions with:
Action type: "FTP Put", Status code: "-1", Status text: "In Progress", with a start time but no end time.
On the filezilla side i can also see multiple session ID's that keep muliplying.
When i rebout the ewon i can see "FTP Session 29 xxx.xxx.xxx.xxx [Status] Client did not properly shut down TLS connection" and 
"FTP Session 29 xxx.xxx.xxx.xxx [Error] GnuTLS error -110: The TLS connection was non-properly terminated"

I've tried several things, active vs passive, adding the port / removing the port, adding the c$/ removing it.
Stopping the script execution also seems to not close the connection. It either get closed by timeout or rebooting the Ewon.

Thanks in advance for any help!


Alright found the problem.

The protocol on the Filezilla Server side should be "Explicit FTP over TLS and insecure plain FTP".
I had it on "Implicit FTP over TLS (deprecated)".

My bad

Continue reading..

  Can I pass an array as a parameter to a function?
Posted by: Andy Hardy - 15-05-2025, 04:17 PM - No Replies

Hello hivemind.

I want to write a function  that takes an array of 6 real values, moves the data in the array down 1 place (like a stack) then adds a new real value to the top of the stack (position 1). I want to pass the name of the array variable and the tag name of the new data to the function, then have the function update the array. I have tried to create a dummy array and declared that as a variable in the definition, and the actual array name in the function call but it keeps returning "invalid parameter". Is it possible to pass an array to a function?

Thanks

And

Continue reading..

Forum Statistics
Members: 6.017,   Forum threads: 2.460,   Forum posts: 8.927,   Latest member: jgrubbs,   Full Statistics



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy