LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with parity and flow control using visa serial

I am trying to create a basic user interface with the options that my company uses most often for a force indicator.  You can configure the indicator over serial, as well as read the values off the indicator.  I am trying to create the user interface so that using producer/consumer loops with events, once you change a value, it will write that new value to the serial port, ie the device. 

The problem I am having is transfering the parity and flow control values for the serial config to the Basic read write VI.  The problem is that once the consumer loop executes, it will write the values correctly to the VI, but then the outer loop executes 200 ms later and clears the values.  I know that this is normal behavior and that in order to keep the values stored, normally you would use a shift register.  I tried to use this and had some issues with correct data types/array mis-mtaches, ets, so I created an indicator and had a local vaible read the indicator, which seems to be working for the stop bits, read bits, baud rate, etc, but not the parity anf flow control.  I always get "blank" outputs for theses values (if you enable the digital display you can see that they are outputing the value 0 which correspondes to None in both cases, which is correct).  Even though it appears that it is outputting the correct value, I get an error that says the VISA property is invalid.  I initally did a search and found that my stop bit control was wrong (outputting double instead of integer), but I could not find anything on the parity/flow control issue.  I even tried to copy the serial config controls from the basic serial read/write to my dialog box and that did not work either.

I would be grateful for any suggestions.

Thanks

Kenny
Kenny

0 Kudos
Message 1 of 4
(2,881 Views)
I should add that I am using LV 8.0 and that the serial config indicator in the consumer loop will be off the frontpanel in the final VI so that it is not visible to the user.
Kenny

0 Kudos
Message 2 of 4
(2,879 Views)
One thing that's wrong is that the data type for flow control and parity in the cluster constant don't match what you've got in the dialog or what Basic Serial Write and Read use. In the constant, you've got them defined as enums and they should be ring constants.
Message 3 of 4
(2,871 Views)

Thanks for your fast response.  I forgot that I had changed the controls in the dialog.  Good eyes. 

 

Thanks again,

 

Kenny

Kenny

0 Kudos
Message 4 of 4
(2,865 Views)