Zou Posted October 20, 2016 Report Share Posted October 20, 2016 I can get the refnum of the cRIO target, but seems no way to get to the chassis/modules/channels of the target. Properties: Owned Items only returns sub VIs. Properties: Find Children returns empty array. Quote Link to comment
jacobson Posted October 21, 2016 Report Share Posted October 21, 2016 Can you attach a simple project you are working with that has modules that doesn't show up using the OwnedItems[] property? Once I got the reference to the project I was able to use the Targets property to get a reference to the cRIO item and then dig down using the OwnedItems[] property. The RT target owns the chassis which can own both modules and the FPGA target. The FPGA target can also have modules as the owned items so you may have to dig down to find what you are looking for but it should be there. For each level of owned items I used the DisplayName property to see what was there and was able to find modules under the chassis and FPGA. Alternatively, if you are looking for a more run time based approach there is the new SMI toolkit. https://decibel.ni.com/content/docs/DOC-48647 1 Quote Link to comment
Zou Posted October 21, 2016 Author Report Share Posted October 21, 2016 Thanks for reply. It works. I have no idea why it doesn't yesterday. I can get modules and channels. But I can't seem to get the module type. e.g. NI-9207 SMI toolkit doesn't work for us as it doesn't support the modules we use. Quote Link to comment
jacobson Posted October 22, 2016 Report Share Posted October 22, 2016 The only way I could find to get the module type would be to use the Get Tag method of the project item and use the tag crio.Type. You can get a lot of other information that way, just look at the project XML to see what tag you want to use. The following is purely speculation on my part but I would not expect there to be a simple way to interact with the modules through scripting because the cRIO project items are populated by a project provider from the RIO driver so it doesn't get any more specific than project item in the VI server 1 Quote Link to comment
Zou Posted November 8, 2016 Author Report Share Posted November 8, 2016 I found that using I/O Variable Container, I can get channel list programmatically. Quote Link to comment
jacobson Posted November 8, 2016 Report Share Posted November 8, 2016 That's good to know, where do you start from to get that container reference though? Quote Link to comment
Zou Posted November 9, 2016 Author Report Share Posted November 9, 2016 From this document: http://zone.ni.com/reference/en-XX/help/371361M-01/lvioscanhelp/blockioaccess/ 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.