Help with BASIC Scripting in viewON

Hi there, I’ve been recently tasked to create an application with a Flexy205 using viewON (4.0.1). I need to be able to write scripts, save historical data and send emails when alarms are triggered. I’ve been looking through your literature for BASIC Scripting and having a hard time getting things to work properly. I was hoping you could clarify a few things for me:

  1. When scripting, should I be writing BASIC scripts in the tag view database (Actions -> Send command -> Tag to write: BASIC script) or should I have 1 big script in the BASIC IDE on the Flexy’s web server? Could I then call a function from a button on viewON application?

  2. Does the Flexy need to be powered in order to test the BASIC script if I am testing simple logic? e.g:

ONCHANGE “Tag_Bool_1”,“Goto UpdateCounter”
UpdateCounter:
IF(Tag_Bool_1@) THEN
Temp_Lvl@ = Temp_Lvl @ + 1
END IF
END

  • Tag_Bool_1 and Temp_Lvl are both eWON Tags
  • When I execute this BASIC script from a Button (Actions: Send Command) nothing changes

Let me know if you can help, thanks in advance.

Brandon

Hi Brandon,

Is there any reason that you want to do all of this through ViewON? Most of these features are already available on the eWON’s main page. When you create a tag, you can set the tag to historically log the data either on a timer or with a deadband. For example if you set the device to log with a deadband of 1, anytime that tag changes by a value of at least 1, that value will be recorded.

You can also setup alarms for the tags in the tag setup area as well, and there’s an additional section where you can choose who to email, if you want the email to have certain logs or other info.

If you want to send emails through the BASIC IDE instead, I have an example doc made up here:
Sending Emails with a Flexy.docx (433.3 KB)

-Tim

Thanks for the quick reply Tim. I wasn’t aware I could achieve this through just the eWON itself. That will save me lots of time, thank you.

As for the scripting part, I will still have to do a little bit of scripting and wanted to know if I should be writing the scripts in the tag view database or in the BASIC IDE of the eWON?

Thanks,

Brandon

Hi @bdoucet,

I’d recommend writing them in the eWON’s BASIC IDE section just because I think we’d have an easier time debugging if there’s issues thanks to the console section located below the IDE.