LabVIEWForum.de - Initialisierte Matrix in Formelknoten

LabVIEWForum.de

Normale Version: Initialisierte Matrix in Formelknoten
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Was muss ich ändern um in einem Formelknoten eine initialisierte Matrix wie (aus C) hinzubekommen ?
Ich habe den Datentyp auf uInt8 geändert, dann meckert LabVIEW
Zitat:Indexliste erwartet.Fehler in Zeile 1 ist durch ein '#' markiert: "uInt8 auchCRCHi []#= {
dann hab ich in die klammer [256] geschrieben und bekomme:
Zitat:Fehlendes Semikolon
Fehler in Zeile 1 ist durch ein '#' markiert: "...t8 auchCRCHi [256]=#

Code:
static char auchCRCLo [ ] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40
};
Brauchst Du das unbedingt im Formelknoten?
Damit kenne ich mich leider nicht so aus (so wenig wie in C).
Aber Du könntest sowas doch auch mit Arrays (oder den LabVIEW-internen Matrix-Funktionen) machen.

Gruß Markus
' schrieb:Was muss ich ändern um in einem Formelknoten eine initialisierte Matrix wie (aus C) hinzubekommen ?
Ich habe den Datentyp auf uInt8 geändert, dann meckert LabVIEW

dann hab ich in die klammer [256] geschrieben und bekomme:
Code:
static char auchCRCLo [ ] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,...
};

Hallo Shining,

erstmal verstehe ich unter einer Matrix, ein zwei-dimensionales Array, das könntest Du ja, wie auch schon genannt, per Array-Konstante in LV initialisieren und nur dem Formelknoten übergeben.

Eine m-n-Matrix könntest Du allerdings auch als
Code:
char blubb [m] [n] ={{a00,a01},{a10,a11}};
definieren.

Wobei ich mir jetzt nicht sicher bin ob der Formelknoten static unterstützt..

Gruß,
Rob

PS:

[Bild: matrix_transform.png]
Referenz-URLs