NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get number of sequences in Sequence File List Vivew of CVI User Interface

Howdy all,
 
I am trying to read the number of open sequences in the List Bar so that I can know when there are none to be able to hide/display my custom entry point command buttons. I tried using the following commands:
 
 tsErrChk( TSUI_ListBarGetPages(gMainWindow.listBar, &errorInfo, &pages));
 
 tsErrChk( TSUI_ListBarPagesGetItem(pages, &errorInfo, CA_VariantLong(SEQUENCE_FILES_PAGE_INDEX), &page));
 
tsErrChk( TSUI_ListBarPagesGetCount (page, &errorInfo, &count));
 
but it doesn't work properly. I've tried multiple variations on ListBar and TSUI_SequenceFileViewMgrGetConnections commands as well as trying to use the function below
 
TSUISUPP_SequenceFileListConnectionsGetCount (objectHandle, NULL, &count);
 
but I can't figure out what Object to use for a handle and if it will return the sequence count or the # of connections.
 
Any help would be greatly appreciated.
 
Thanks,
 
-Jack
0 Kudos
Message 1 of 3
(3,297 Views)
Jack,

As long as you are connecting the listbar page to the SequenceFileList, the simplest method may be to go right to the source- the ApplicationMgr.
 
You can call the method ApplicationMgr.SequenceFiles to get a list of sequence files.  Once you obtain this list, you can get SequenceFiles.Count.
 
Allen P.
NI
Message 2 of 3
(3,295 Views)

Allen,

That's a 5-star reply, and quick too! I just tested it and it works just fine. The code below did exactly what I wanted:

 tsErrChk( TSUI_ApplicationMgrGetSequenceFiles (gMainWindow.applicationMgr, &errorInfo, &seqFileList));

 tsErrChk( TSUI_SequenceFilesGetCount (seqFileList, &errorInfo, &count));

Thanks!

-Jack

Message 3 of 3
(3,287 Views)