LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically setting up the Cursor in specific locations withinh individual cells of the Table

Hi,

I am trying to figure out a way of how programmatically place the Cursor in a specific location of a cell in an Table. Below I have attached a VI that I am using. As you can see in the VI I have a Table that has four coloumns I am more interested in Columns where it says MAC Address, Board Type and Serial Number.

My goal is when I run the VI and select how many boards are present in the shelf the first thing it should do is to place the cursor in column 1 and row 2 and it should place the cursor right after  "00A555". Then when I enter 6 additional numbers (example: 00A555123456) after pressing a carrige return key the cursor should go into
column 2 row 2. In this cell I would like the cursor to be right after "MA0". Then when I enter 10 additional charcters (example: MA0303-101-AA) after pressing carrige return key the cursor should go into column 3 row 2. In this cell I am going to enter a serial number (example:123456789-10). Once I am finished with this cell and after the carrige return the cursor should go into column 1 row 3 and the process should repeat itself for all 8 UUT's.

I would really appriciate if someone could help me out with this problem.

Thanks
0 Kudos
Message 1 of 2
(2,695 Views)
I'm not sure there's any built-in mechanism for automatically moving the cursor to the end of the text, but you can replicate this behavior by using the OS. I'm assuming you're on WIndows, so you can use the SendInput function to send keystrokes to the active window. Once you do this you will need to count the character that have been entered. You can do this using an event structure, so your loop in frame 3 needs an event structure.

To simulate sending keystrokes you can take a look at the attached VI, which is a modified version of a VI posted on the LAVA forums.

A few other notes regarding your VI:
  • I would think that you would want the "MAC Address", "Board Type" and "Serial Number" strings in the column headers, rather than the first row of the table.
  • In frame 1 the loop is irrelevant. The code will stop waiting for the user to finish with the dialog box, and since the dialog has only one possible output value, the loop serves no purpose.
  • The dialog allows the entry of negative numbers.
  • You don't need the "Number of Boards" to control your loop. Simply auto-index your table.
Message 2 of 2
(2,665 Views)