JAVA and BASIC Script

Hello, I’m currently trying to run a BASIC script and a Java .jar file simultaneously on an eWON. If the BASIC script is running and I try to start the .jar file, the .jar file won’t start. If the .jar file is running and the BASIC script is started, the .jar file stops working. The realtime logs also indicate this. Are there any prerequisites (or hints and tips) for getting both these files to run simultaneously?

KInd regards.

Hello, is there any information that you can give me? Have you tried this yet and does this work?

Hello @nmbedm ,

They should be able to run at the same time, Im not aware of any thing special that needs to happen to allow this. You could be running into a resource limit depending on how much you are doing in both applications. You might want to check how much memory is in use from the status > System Counters > Memory info.
What error are you seeing in the backup? Can you upload a backup for us to look at?

Deryck

Hello, thank you for the quick response.

  1. We have an eWON Java client program and a BASIC program that we want to run simultaneously.
  2. I noticed in the realtime logs that once the BASIC program started, no more logs from the Java program appear in the file (in the Realtime logs, the “Source” is set to “All sources”). It appears that the BASIC program blocks the Java program.
  3. To rule out issues with either the Java or BASIC program, I’ve created a new Java program that simply kills time and writes to the screen. I’ve also created a new BASIC program that simply prints to the screen every 5 seconds.
  4. Both programs as well as a screenshot of the logs are attached.
  5. In “onlyJavaProgramExecutes.png” - the Java program starts at 07:41:01 and ends at 07:41:36.
  6. In “BasicBlocksJava.png” - the Java program starts at 08:17:16, the BASIC program executes between 08:17:23 and 08:26:29. No logs are received from the JVM until the BASIC program is stopped. So the Java program ends at 08:26:58. Almost 9 minutes.
  7. You can try this yourself or use your own programs.
  8. The eWON Firmware version: 14.2s0(#1190JavaBasicMain.java (1.1 KB) eWON_Code.txt (177 Bytes) )

Hi nmbedm!

The first thing i think about when I read that would be:
The text code of the Basic Code in which section did you add the Timer?
You should not add anything in the cyclic Section. This can result in some problems…

Could you upload the backup.tar? So I can see the logs and the configuration? This would give me the complete picture of your setup, So I can check if I find something unusual.
And for the ‘Support Backup tar’ Please use ebuddy and choose Backup > with the supportfiles (that is an extra checkmark).

And thanks for the description! It’s always helpful to have pictures and a description what happened when!

One more Tipp:
For example here is a Program that makes it even possible to exchange Data (albeit slowly) between Basic and Java. The two Programms also run sidebyside. Maybe this can give you some inspiration?

br
Franziska

Hello Franziska, thank you for the quick response.

  1. We don’t use the Cyclic section - ever.
  2. I don’t currently need to exchange data between Basic and Java but I will examine the program you’ve included.
  3. Unfortunately, a network update was done last week and since then eBuddy can’t see our local eWONs, so I can’t provide a backup.tar via eBuddy. I have included a backup.tar that I obtained via FTP. I don’t know if this will include the support files.
  4. Have you tried testing whether a Java program (that does nothing relevant) and a similar BASIC program can run concurrently? Any simple test will do (I included 2 such programs earlier).
  5. If the answer to (4) is yes, please let me know so I can continue trying to resolve this at my end.

Kind regards.MOVED TO STAFF NOTE (601.5 KB)

.

In the Backup.tar there only was the program.bas inside. I could find a lot of REM Commentary inside the Cyclic Section.
Please leave the Cyclic Section empty.

In the last post I attached a Program that uses Java and Basic at the same time. (As you want to do) even if you do not wish to exchange data between the two programs.
Please follow the example in this Program.

And delete everything from the Cyclic Section. - even the REM Comments.

br
Franziska

1 Like

Hello Franziska,

thank you for your help, it’s much appreciated. You were correct - the comments in the Cyclic section caused the issues.
In our ‘proper’ programs (customer code), the cyclic section is devoid of comments and code. This eWON is used for development and testing and I made the error.

2 Likes

This was helpful in getting my BASIC script to run simultaneously with a Java app.

It’s unfortunate that nothing can be in the Cyclic section because I’ve found that ONWAN, ONVPN, & ONCHANGE don’t trigger reliably in the Init Section.