frangoteam / FUXA

Web-based Process Visualization (SCADA/HMI/Dashboard) software
https://frangoteam.org
MIT License
2.84k stars 826 forks source link

[BUG]The $getTag() method cannot get the value of the internal data #1479

Open yy783 opened 1 week ago

yy783 commented 1 week ago

Describe the bug Execute the function of opening the card and bind an internal variable A to S7 variable B, click the button to execute the script on the Open Card interface, the input parameter is the internal variable A, the script content is console.log($getTag(a)), and the printed result is undefined.

To Reproduce Steps to reproduce the behavior:

  1. Draw a square, set the click event to Open Card, bind an internal variable to an S7 variable
  2. There is a button in the interface of the card being opened, and the click event of the button is: execute the test script console.log($getTag(a)), and a is the internal variable bound when the card is opene. The script mode is client
  3. Edge browser output is undefined
unocelli commented 1 week ago

Hi, since internal device is only accessible on the frontend, it could be possible to add the feature for scripts in client mode

yy783 commented 3 days ago

The mode I'm using is the client mode, I printed the object with the target id in $getTag, but there is no “value” attribute, so the $getTag() method always returns undefined

unocelli commented 17 hours ago

Hi, I try to understand your description and I am confused to understand what your purpose is

yy783 commented 11 hours ago

For example, there is an S7 variable called “LQB1_RunByte”, and there is an internal variable called “runByte”. In the click event of a certain element, it is set to “Open Card” to open “view1” and bind “runByte” and “LQB1_RunByte”. There is a button in “view1”, and when the button is clicked, the "Client-Mode" script "console.log($getTag(runByte))" is executed. The script prints a "null" or "undefined" result. My goal is to create a common card interface for objects of the same type.

yy783 commented 11 hours ago

bug1_1 bug1_2 bug1_3 bug1_4