eWON BASIC variables displayed in ViewON

HMS Support,

I have a large array of variables that have been calculated and stored in an array in BASIC.

I want to import these variables into ViewON. What is the best way to achieve this?

Im thinking there is a basic command to set a memory TAG, Then import the tags into viewon, so that I don’t need to use the GUI to set hundreds of memory tags.

Let me know what you think

Thanks for your support

@m_ross

You should have access to your eWON’s BASIC variables in viewON as well.
Have you tried accessing your array using BASIC in viewON?

Hi Joe,

Do you have an example of how that is done?

Currently what I am doing is from viewon going to Project>Import Tags, then all the tags in the eWON are usable within viewon. Is there a similar operation for connecting basic variables?

Thanks

@m_ross

The BASIC IDE in the eWON and the BASIC scripting section in viewON are the same.
You do not need to import them into viewON, and can use them on demand.

For example, if I have a text element, I can send it the value of a string variable I have in my eWON by navigating to the actions tab and then selecting send string. In here, you have a BASIC script under tag to write.

Hi Joe

That sounds exactly what I’m looking for, although I’m testing it out and can’t quite seem to get it to work. See attached picture. I don’t see the action ‘send string’. What object are you sending the action to?

Picture2

@m_ross

If you are trying to display string variables then you will need to use the animations tab.

You can do this with that object by navigating to animations and then right clicking.
Choose Text --> Simple

Basic script used
image

I’d take a look at the ViewON4 manual as it reviews a lot of this information.

Page 39/40
https://websupport.ewon.biz/sites/default/files/aug-005-2-en-viewon_-_getting_started.pdf

Hi Joe,

I am following the viewon reference guide but I cant seem to figure out what is going wrong. I’ll try to be as clear as possible so maybe you can help me figure out the error.

Here’s my original test, with ewon tag values updating correctly

Then I add in the following basic script to display the time.

This results in an error. Even my previously working tags no longer work.

Thanks

@m_ross

The second screenshot is too small to read the text.
If you are trying to display the time in a viewON text element then you can use the time$ string.

We have an example located here:

Yeah, that’s the code I’m using.

viewon! = TIME$

I don’t understand why it doesn’t work.

@m_ross

That line of code appears correct.

If you are still experiencing issues, can you please send me a copy of your project?

Hi Joe,

I solved part of the puzzle. Do you have experience with the viewon BASIC? It seems a lot more touchy than the eWON’s BASIC. Viewon requires the basic commands to be spaced. I now see my original code was “viewon!=TIME$” but should have been “viewon! = TIME$”

Next I’m trying to put values into the “viewon!” variable. I can do it with Reals by converting them to a string first with the command STR$

Viewon! = STR$ myreal

But I can’t seem do it with integers, the below code doesn’t work in Viewon, but works fine in the eWON IDE.

Viewon! = STR$ myint%

Trying another way doesn’t work either:

Viewon! = SFMT myint%,30,0,"%d"

Do you know how to put integers into the ‘Viewon!’ Variable?

Thanks

@m_ross

It’s definitely a bit touchy when compared to the BASIC IDE. The example code in your screenshots above showed the spaces so I thought the format was correct.

I am also experiencing an issue with displaying integers in a text element.
It should just be viewon! = STR$ myint% as you described.

I have escalated your question to our development team as I believe you may have found a bug.

For now, I would try converting the integers to a float or string in the BASIC IDE rather than in viewon.

@m_ross

I got a response back from our team in Belgium regarding the int variable issue in viewON BASIC.

They said this is a known bug with using integers in viewON due to the way HTML5 interprets the % symbol. Unfortunately, they have not provided a timeline on when a fix will be implemented.

Workaround

You can convert this integer variable to a float or string in the eWON’s BASIC IDE or you can create a MEM tag in the eWON device, and then assign that integer variable value to the MEM tag value using BASIC in the eWON.

Example:

MyInt% = 33
my_tag@ = Myint%

In viewON, use text on measure under animations for your text element to display the mem tag. Please remember to import your tags into viewON if you add any new tags.