12-20-2018 09:15 PM
Hi,
Is there anyway to get the Project: Diagram Disable Symbols programatically i.e,using some nodes.
Thanks in advance.
12-21-2018 01:48 AM
12-21-2018 06:41 AM
@pincpanter wrote:
It seems to be a hot topic. See for example this and this.
Those posts are pretty recent. Next time, try to search yourself into the forum.
Those threads are about how to set them. Question here is how to get them. I don't think the answer is in those threads.
This is where to go: Programmatic-read-access-to-project-symbols.
12-21-2018 06:58 AM
wiebe@CARYA ha scritto:
@pincpanter wrote:
It seems to be a hot topic. See for example this and this.
Those posts are pretty recent. Next time, try to search yourself into the forum.
Those threads are about how to set them. Question here is how to get them. I don't think the answer is in those threads.
This is where to go: Programmatic-read-access-to-project-symbols.
You are right, although I don't see much point in getting them, as usually they are indirectly accessed by means of conditional disable structures.
12-21-2018 07:33 AM
@pincpanter wrote:
wiebe@CARYA ha scritto:
@pincpanter wrote:
It seems to be a hot topic. See for example this and this.
Those posts are pretty recent. Next time, try to search yourself into the forum.
Those threads are about how to set them. Question here is how to get them. I don't think the answer is in those threads.
This is where to go: Programmatic-read-access-to-project-symbols.
You are right, although I don't see much point in getting them, as usually they are indirectly accessed by means of conditional disable structures.
I saw that coming.
A CDS causes a code change and potential SCC change. Although you can minimize this to just one VI, reading the string can bring this down to 0.
It also allows fancier utilization then switching a case. You could compose your own project symbols, and for instance store coordinates in them. That makes them more a global string then a switch.
So, although the 'proper' use case for a project symbol is to use it in a conditional disable structure, you can use (misuse? abuse?) them for other things.
12-21-2018 12:35 PM - edited 12-21-2018 12:36 PM
How about reading the Project XML file?
I created a dummy project and added 2 conditional disable symbols in it. I found them near the top of the XML file. Under Property Name "CCSymbols"
<Project Type="Project" LVVersion="18008000"> <Property Name="CCSymbols" Type="Str">Test1,A;Test2,B;</Property> <Property Name="NI.LV.All.SourceOnly" Type="Bool">false</Property> <Property Name="NI.Project.Description" Type="Str"></Property> <Item Name="My Computer" Type="My Computer"> <Property Name="IOScan.Faults" Type="Str"></Property> <Property Name="IOScan.NetVarPeriod" Type="UInt">100</Property> <Property Name="IOScan.NetWatchdogEnabled" Type="Bool">false</Property> <Property Name="IOScan.Period" Type="UInt">10000</Property> <Property Name="IOScan.PowerupMode" Type="UInt">0</Property> <Property Name="IOScan.Priority" Type="UInt">9</Property> <Property Name="IOScan.ReportModeConflict" Type="Bool">true</Property> <Property Name="IOScan.StartEngineOnDeploy" Type="Bool">false</Property> <Property Name="server.app.propertiesEnabled" Type="Bool">true</Property> <Property Name="server.control.propertiesEnabled" Type="Bool">true</Property> <Property Name="server.tcp.enabled" Type="Bool">false</Property> <Property Name="server.tcp.port" Type="Int">0</Property> <Property Name="server.tcp.serviceName" Type="Str">My Computer/VI Server</Property> <Property Name="server.tcp.serviceName.default" Type="Str">My Computer/VI Server</Property> <Property Name="server.vi.callsEnabled" Type="Bool">true</Property> <Property Name="server.vi.propertiesEnabled" Type="Bool">true</Property> <Property Name="specify.custom.address" Type="Bool">false</Property> <Item Name="Untitled 3.vi" Type="VI" URL="../Untitled 3.vi"/> <Item Name="Dependencies" Type="Dependencies"/> <Item Name="Build Specifications" Type="Build"/> </Item> </Project>
Of course the project needs to have been saved for them to show up.
01-07-2019 02:43 AM
Reading the file can be dangerous, the file might not have been saved.
You can get those strings from the project root. Get the tag called "CCSymbols" (IIRC, OTOMH), and you'll get the current symbols.
01-07-2019 06:39 AM
wiebe@CARYA wrote:
Reading the file can be dangerous, the file might not have been saved.
Yes. I did say that in my message, last line, that the project file needs to be saved.
01-07-2019 06:43 AM
@RavensFan wrote:
wiebe@CARYA wrote:
Reading the file can be dangerous, the file might not have been saved.
Yes. I did say that in my message, last line, that the project file needs to be saved.
Ah. I see. But what would be the up side of reading the file then?
01-07-2019 07:48 AM
I'm not suggesting there was an upside. Just that there still seemed to be negativity about the responses received, so I was suggesting another alternative.