LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array string

Hi,

 

I'm trying to communicate with an outer module(mrc-1) via RS-232.

When I send some command to read some values of my modules,

the response on Port2 in my program is following,

re 0 0 4

RE 0 0 4 0

mrc-1>

 

Here, "re 0 0 4" is the command I send and "RE 0 0 4 0" is the result I need.

 

I made some array to display the result, but the array display only "re 0 0 4" .

What should I do in order to display the result "RE 0 0 4 0" ?

 

Once I tried to use "Search and Replace String" function to remove the "\n" , but it didn't work.

 

Download All
0 Kudos
Message 1 of 8
(2,643 Views)

You probably have the termination character set for end of line. This will cause the read to terminate after this termination character. Just read again.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 8
(2,633 Views)

Thank you for your advise.

I tried to read once more, but it didn't change...

0 Kudos
Message 3 of 8
(2,630 Views)

How big is your Read_FIFO DMA?  My guess is that it is set to 8 (which would cut off your data).  Try setting it to something larger, like 128.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(2,623 Views)

I just looked at your code. I have never used FPGA but I think that the code in "step 2" should be outside of the loop. Just for clarification, is the result:

 

re 0 0 4

RE 0 0 4 0

mrc-1>

 

Being shown in the string indicator "Port 2"? Or is the program only reading the first line? If it is reading everything and you only want the second row to be displayed, then you can use the Pick Line function under Additional String Functions.

=====================
LabVIEW 2012


0 Kudos
Message 5 of 8
(2,614 Views)

Thank you.

What is read FIFI DMA ??

 

I guess there is no problem with it because I can read all of responce with Port 2 display.

The problem is that array2 does't display the same words as the Port2 even if input of Port2 and array2 is the same.

0 Kudos
Message 6 of 8
(2,613 Views)

@Tatsuya.F wrote:

Thank you.

What is read FIFI DMA ??

 

I guess there is no problem with it because I can read all of responce with Port 2 display.

The problem is that array2 does't display the same words as the Port2 even if input of Port2 and array2 is the same.


Read_FIFO is the DMA that you are using to pass the serial data from the FPGA to the host.  If you look in the project, you can configure how many elements can be held in the FIFO.

 

Where is array2?  I don't see any front panel arrays on either VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(2,607 Views)

Hi, sorry to take long time to response you.

 

The Pick Line function was exactly what I needed !

Thank you for your help and I appreciate averyone's help.

 

 I am facing another challenge.

Now I can read only one parameter by sending command "re 0 0 4".

This command is for reading the gain of my amprifier.

 

I want to read gain values of other channels at the same time.

I can read other channels separately by sending following commands,

   re 0 0 0 (this is for channel 0)

   re 0 0 1 (for channel 1)

   re 0 0 2 (for channel 2)

  ...

 

However, I would like to read these values at the same time just pushing button(something that "scan ! " button) and show the result values in the array.

I think this is difficult because all channels are read by one RS232.

I don't know how to sort my commands and response.

 

Also , I want to make it possible to change these values just by filling the values in the another array.

I can change the values with following commands,

   set 0 0 0 1

   set 0 0 1 1

   set 0 0 2 1

   ....

 

The last values are value(1) setting and third values(0,1,2,...) are channel number.

 

I would like to develop system like the attached PNG image.

I will also attach my current Vi.

 

Could you help me once more, please ?

 

Download All
0 Kudos
Message 8 of 8
(2,576 Views)