キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

LabVIEW MathScript Missing definition variable

My task is to detect the head and end of the frame from a receive massage packet  (1D array), and then store the data in  different array. But the error is:  the variable is not defined in the script,if  the variable is not defined, it is impossible to add output, please help solve it.ThanksMs.PNG

 

0 件の賞賛
メッセージ1/11
5,469件の閲覧回数

Hi USTC,

 

using pure LabVIEW G it would be so much easier to solve your task than by that cryptic MathScript node!

There's no hassle with "variables" once you use wires!

 

Example:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
メッセージ2/11
5,465件の閲覧回数

Because of the large number and 16 channels, I also thought about using Labview G,for example :Index array but I don't know how to program according to the meaning of the code.Can you give me a hint?

0 件の賞賛
メッセージ3/11
5,455件の閲覧回数

Look for a data package  from a 1-D array, 

for example: 1-D array data package :  0 0 0 0 A B 1 2 4 5 6 7 8 9 D   A B 2 5 6 8 4 7 2 1  D   A B 1 2 8 9 6 7 8 9 D   A B 1 2 4 7 5 7 2 1 D .....

A  B : Frame header   😧 trailer  

I want to separate the data in the middle of the end of the frame header into different 1D arrays.

Thank you !

0 件の賞賛
メッセージ4/11
5,479件の閲覧回数

Whether  the length of Date Package is constant.

Simple Logic Will be Index the Start of Data Packet (I1,I2 and In) and Compare with the Expected Values (A,B and D) in a Loop.

Whenever the Comparison satisfies Separate the data in the format of your choice.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 件の賞賛
メッセージ5/11
5,457件の閲覧回数

Instead of "different 1D arrays", I would recommend a 2D array with one row per payload.

 

Do you have the entire data available or is new data coming in continuously? What should happen to incomplete frames? Are all frames of the same lenght?

0 件の賞賛
メッセージ6/11
5,447件の閲覧回数

Hi USTC,

 

what's wrong with my last suggestion?

Why do you think you need to create a new thread for the same topic?

 

separate the data in the middle of the end of the frame header

You really should rephrase this sentence!

What's "in the middle of the end of the header"? 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ7/11
5,438件の閲覧回数

@GerdW

 


@GerdW

Example:

check.png


Thank you for your reply. The tunnel mode output of the loop structure should be a connection instead of  index. If the tunnel mode is the final value or index, the output has only one set of data, and the tunnel mode is  connection. The eligible data is repeated 16 times. Collect output to an array, why?
Question 2: Why use a circular structure to output why use a 2-D array, and take a 1-D array should be fine.

0 件の賞賛
メッセージ8/11
5,391件の閲覧回数

Hi USTC,

 

The tunnel mode output of the loop structure should be a connection instead of  index.

Why do you think so?

When parsing datastreams I prefer to receive an array of "messages" instead of another "stream of messages". That way I can use an autoindexing loop to process those messages. That's why I used the indexing tunnel.

In your case a "message" is a 1D array of values, so my suggestion delivers a 2D array of values.

 

Conclusion: when you prefer concatenated data you could use the concatenation mode. It's up to you!

 

Why use a circular structure to output why use a 2-D array, and take a 1-D array should be fine.

Where do you see a "circular structure"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ9/11
5,388件の閲覧回数

Thank you for your prompt reply. In your plan, there is a problem with the loop structure stopping. It stops when it collects a set of data.


@GerdW捕1获.PNG

 

0 件の賞賛
メッセージ10/11
5,384件の閲覧回数