Author Topic: Embedded variables  (Read 7068 times)

Phrog30

  • Guest
Embedded variables
« on: October 21, 2017, 07:16:08 PM »
I spent some time today working on getting embedded variables to work.  Right now it's rather rough, but I think it should work out nicely.  It works like placeholders in RA software ({#1} - is a pointer to PLC address 1 in the collection).  Right now I have the PLC addresses hard coded, but when it's said and done, it will be a collection that can be edited in the control.  All of this will work without writing a single line of code.  My example has 4 states in a multistate indicator.  Just showing off the potential of AdvancedHMI.

James


timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Embedded variables
« Reply #1 on: November 07, 2017, 07:51:19 AM »
Again this looks REALLY good james.  These controls you're coming up with should be added to the AHMI libraries for sure.
Still just trying to figure out this thing called Life.

Phrog30

  • Guest
Re: Embedded variables
« Reply #2 on: November 07, 2017, 09:50:49 AM »
Thanks, I think Archie is working on several things that should really make things better.  I believe he has been on some projects so time has been hard to come by for him.

James

Phrog30

  • Guest
Re: Embedded variables
« Reply #3 on: April 04, 2018, 09:26:26 AM »
I added this control to a base app and added some examples if anyone is interested.

See later link....

James

Edit: updated, added observable collections
« Last Edit: April 05, 2018, 03:02:27 PM by Phrog30 »

Phrog30

  • Guest
Re: Embedded variables
« Reply #4 on: April 05, 2018, 03:01:37 PM »
Updated, found a few issues:
See later link....

I found an issue I think is CLX driver related.  If I have datasubscriptions to the same string non-82 character the driver will stop working.  I can also duplicate if I drop two basic labels and point to the same string non-82 character.  Hopefully Archie can duplicate and issue a fix.  (The Beta version seems to have addressed this issue!)

James
« Last Edit: April 09, 2018, 01:36:19 PM by Phrog30 »

Phrog30

  • Guest
Re: Embedded variables
« Reply #5 on: April 09, 2018, 01:35:25 PM »
I think I have all bugs fixed.  I added INI for messages and embedded variables.
Here's the app: https://drive.google.com/file/d/1GqH4FxCVq8GCQGnNjzITB7D-E_7L0I2W/view?usp=sharing

If anyone needs a write up on this control, please let me know.  I don't want to spend time on something that won't get used, but I can make one if it will help someone.  The basic premise is you have state collections and embedded collections.  If you want to use a PLC value in a state, like time, pressure, temperature, etc., you add this address to the embedded collection.  You only need to add the name.  You never need to worry about the value.  The data type only becomes an issue when dealing with custom length strings in CpLX/CLX.  If you need to use a custom length string, which is basically anything other than 82 characters, you will select partial string.  All other times you can enter any data type, as of right now I'm only looking for partials.  The order in which you enter embedded variables is how you reference them in the states, starting at 0.  So, the first embedded variable is referenced by typing {#0}.  The next variable is {#1}, and so on.  It needs entered exact.  This, { #1} will not work.  You can reference these variables many times in the same state, or other states.  For example,  the first state message can be, "Step 1 on wash cycle, water temp = {#0}, time remaining = {#1} seconds".  I could also enter, "Step 1 on wash cycle, water temp = {#0}, time remaining = {#1}, by the way water temp = {#0}".  If you want to use the value of the control itself, you can enter {#Me}.  There are slight differences between the multistate and analog, the main difference being one allows an entry.

James
« Last Edit: April 09, 2018, 01:54:47 PM by Phrog30 »

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: Embedded variables
« Reply #6 on: April 29, 2018, 02:55:36 PM »
I tried it and it seems to be a neat control (as the attached picture shows).

Arvanoss

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Embedded variables
« Reply #7 on: August 16, 2018, 11:30:16 AM »
Gentlemen,

I would like to use Embedded Variables in my project.  I have looked over your example and tried to figure out how to make it work but I am stuck.

Background:
I have a "Screen" that I need to display the data from 64 (Identical) stations on the plant floor based on the selection from a dropdown box. 
I can build all of the "pop-up screens" and overlay them but thought it would be better to use Embedded Variables.

The Multistate used in your example allows for connection to a .txt file with all the states listed but in the Beta12 release that function is not available.  How can I use the Embedded Variables in my project?
There will be as many as 18 Embedded Analog data points and digital indicators related to the 64 stations.

Thanks
Randy


Phrog30

  • Guest
Re: Embedded variables
« Reply #8 on: August 17, 2018, 01:03:40 PM »
What exactly do you need help with? Have you been able to add the control to your project?

Arvanoss

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Embedded variables
« Reply #9 on: August 20, 2018, 01:00:10 PM »
I have not added the control to my project, sorry to say I don't know how to include the control.

Edit:  I did figure it out...I looked around forum and found how to add the controls to my project.

Thanks
Randy
« Last Edit: August 21, 2018, 10:36:36 AM by Arvanoss »

Phrog30

  • Guest
Re: Embedded variables
« Reply #10 on: August 21, 2018, 02:09:00 PM »
There is info on this forum on how to add controls.

Can anyone assist on this, I'm on a start-up.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: Embedded variables
« Reply #11 on: August 21, 2018, 05:19:39 PM »
He already figured it out.

Phrog30

  • Guest
Re: Embedded variables
« Reply #12 on: August 21, 2018, 11:59:19 PM »
He already figured it out.
Good to hear

Arvanoss

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Embedded variables
« Reply #13 on: August 23, 2018, 10:39:02 AM »
Gentlemen,

I have installed, configured and tested several Multistate Indicators with Embedded Variables....These are GREAT.

I have one issue, using the FullString Data Type, when the value is blank or empty the Message is displayed with the placeholder number rather than just a blank space i.e. Job ID 3 for value of 3 in the PLCAddressValue.  I've not used the PartialString yet but I assume it reacts the same.
Is there anything I can do to just display a blank field when the tag data is empty??

Thanks

Phrog30

  • Guest
Re: Embedded variables
« Reply #14 on: August 23, 2018, 11:00:23 AM »
That's interesting, I don't think I ever tested empty strings. I'm not sure I will have time to look into it.

Godra, any chance you could look into this please?