OK, based on the quick success in getting my last query answered, here is another question about Brucontrol scripting that I can't seem to find the answer to:
I'm bringing in the data from 4 iSpindel hydrometers through node red into Brucontrol Data Exchange and storing the data in individual Global elements based on the assigned name of each iSpindel. For example, the global element for Specific gravity for iSpindel0004 is named "SG iSpindel0004" . All that works great. My problem comes when I try to assign a specific iSpindel to a specific fermenter. While it would be simple to permanently assign iSpindel004 to FV4, stuff happens to iSpindels (like low battery or need to recalibrate) or during fermentation and I want to be able to reassign a iSpindel to that fermenter on the fly. Thanks to my previous query above, I wrote a script in brucontrol that goes to two editable global elements ("Select iSpindel by number" and "Select Fermenter by ID") reads the values that are entered and then pushes the data stored from the appropriate iSpindel to the corresponding global elements associated with that FV.
That is fine as long as the global element value is hardwired into the script. For example:
"iSpindel SG FV1" Value = "SG iSpindel0005" Value (which is where the SG value is stored)
Since all my iSpindels have the same naming convention, what I want to do is read the value from "Select iSpindel by number" Global Element and insert that into the "SG iSpindel000x" Value part of the script (above) on the fly.
An abbreviated version of the my approach to the script goes like this:
new string iSpindelNumber
new string iSpindelSelectSG
new string SG
iSpindelNumber = "Select iSpindel by number" Value
iSpindelSelectSG = "SG iSpindel000" + iSpindelNumber
SG = iSpindelSelectSG + " Value"
"iSpindel (SG) FV1" Value = SG
which returns
"iSpindel (SG) FV1" Value = SG iSpindel0004 Value
which is perfect if I could somehow get quotes around the global element name so it looks like this:
"SG iSpindel0004" Value
Other scripting languages have ways to preserve the quote marks in line, but I can't figure out how to do it in Brucontrol. Does anyone have any ideas, or perhaps I am approaching the problem in the wrong way? Thanks in advance for any suggestions