Unpack data channels from cluster
Hi all,
I tried searching for this, it seems common enough, but I'm not sure I used the right set of words:
I'm receiving data from a device in packets. Each packet contains multiple frames, each frame contains two sub-frames, and each sub-frame contains several data channels. In my vi, the packet is a cluster, the frames are clusters, and the sub-frames are clusters, all typedef'ed.
What I want to do, is take the initial big cluster, and split the data into a cluster of arrays, one per data channel, without generating spaghetti.
The "decimate array" function would work beautifully to do the job, but alas, it only operates on arrays, not clusters, and it seems my clusters cannot be converted to arrays.
Is there something I'm missing? I've attached a high-level picture...note I'm not an artist. The values "n" and "m" are fixed, so there is no variability
Solved!
Go to Solution.
Attachments:
ClusterToClusters.png 11 KB
Right-click on Build Array and choose "Concatenate Inputs" so you'll get a 1-D array.
If you get rid of the "Header" and "Footer" elements, you can wire your overall cluster to Cluster to Array, which will give you an array of Frame clusters, which you can then put through a For loop with Cluster to Array, which will give you a 2-D array, that you can reshape/decimate/extract columns or rows as necessary. Or, in newer versions of LabVIEW, you can right-click on the loop output tunnel and choose the option to concatenate, giving you a 1-D array. However, I suspect that the 2-D array will actually work well for you - you'll have frames on one axis, and data channels on the other.
If you need the Header and Footer to remain part of the overall cluster, add one more level of nested cluster (there's no memory/speed penalty) containing all the frames, so that you can unbundle just the data.
Is there any possibility of reading the data into an array in the first place, instead of a cluster? That might be easier.
Similar Messages
-
Data Retrieval from Cluster Table - BSEG
Hi all,
I need to retreive data related to document line items from BSEG whose CLEARING DATE (AUGDT) is greater than a user given date for TWO COMPANY CODES (say 0010/0200).
as BSEG is a cluster table, it has huge data and taking large amt of time can anybody suggest a better way of retrieving data for the above conditions(fastly)
Thanks in Advance,
Lakshmihi,
use second. index tables:
customers: BSAD
vendors: BSAK
G/L acc.: BSAS
sample:
SELECT (felder) FROM bsad into TABLE stab
WHERE bukrs = bukrs
AND kunnr IN kunnr
AND gsber IN gsber
AND augbl <> space
AND hkont IN akont
AND augdt GT p_date.
regards Andreas
Message was edited by: Andreas Mann -
Hi,
i would like to retreive payroll results from it's allocated cluster tables using buffer.
i donot know how to use BUFFER concept and it's statments.
could anyone guide me in this topic?
thanks
theresita.jHi theresita,
i would like to retreive payroll results from it's allocated cluster tables .
1. U want the remuneration (monthly salary )
2. U won't get it DIRECTLY from any table.
(Its stored in cluster format)
3. Use this logic and FM.
DATA: myseqnr LIKE hrpy_rgdir-seqnr.
DATA : mypy TYPE payin_result.
DATA : myrt LIKE TABLE OF pc207 WITH HEADER LINE.
SELECT SINGLE seqnr FROM hrpy_rgdir
INTO myseqnr
WHERE pernr = mypernr
AND fpper = '200409'
AND srtza = 'A'.
IF sy-subrc = 0.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = 'IN'
employeenumber = mypernr
sequencenumber = myseqnr
CHANGING
payroll_result = mypy
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
error_reading_archive = 8
error_reading_relid = 9
OTHERS = 10.
myrt[] = mypy-inter-rt.
READ TABLE myrt WITH KEY lgart = '1899'.
4. the internal table myrt
will contain what u require.
I dont think there is any buffering concept
involved in cluster table.
regards,
amit m. -
Comapre 2 same channels from two different dat filea
Hi ,
I want to compare the wave forms of two same channels names (in my sample data which is in attachment, the same channel names are S1KNSLLE00H3DSZP) from different dat file(S2100044 and S2100041) .
Load the 2 dat files from navigator.
Come to report and open two 2d axis systems to see the wave forms of two different channels ( Like in attachment result.jpg)
I need an autosequence to do the same for all the channels for 2 dat files automatically.
Attachments:
cmp.zip 1967 KB
result.JPG 158 KBHi RSH,
I appreciate you posting 2 data files and the jpg, but I'm afraid I still have lots of questions before I can advise you. You sent 2 *.dat files which each had 1 channel in them named "Data", which is different from your email text and the jpg you posted. Will your data sets typically have many channels in them? Your posted *.dat files had no time channel and the "Data" channel was not a waveform channel, yet the 2 different "Data" channels were different lengths. Do you want to plot your channels vs. the array index all the time (as is shown in your jpg)?
Do you want to have N sheets in REPORT, one for each channel? Why don't you want to have both "S1KNSLLE00H3DSZP" channels as curves with different colors on the same graph-- wouldn't that make it easier to compare them?
When you drag over the data channel onto a REPORT graph, you will get a reference like "[1]/Data" or "[2]/Data", which is exactly what you want to compare the "Data" channel from 2 arbitrary data files (note that the file name does not show up in the channel references). So it seems to me that the REPORT layout you sent a jpg of already satisfies what you're asking us to create for you. Why do you need a script at all?
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
How to Extract data from Cluster table and transperant table
Hello BW Experts ,
I want to extract the data from cluster table BSEG and a transperant table BKPF .
The primary fields are BELNR , GJHAR and BUKRS.
the fields of table BKPF to extarct is BUDAT and fields of BSEG table is HKONT , BSCHL , ZUONR and POSID.
I can not create a view over these two tables as BSEG is a Cluster table.
Please guide me.
Regadrs ,
Amol.hi Amol,
take a look Sigg's weblog
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
you can use RSAX_BIW_GET_DATA_SIMPLE as sample, there specified import parameters
FUNCTION RSAX_BIW_GET_DATA_SIMPLE.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE SFLIGHT OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER -
SELECT is taking lot of time to fetch data from cluster table BSET
<Modified the subject line>
Hi experts,
I want to fetch data of some fields from bset table but it is taking a lot of time as the table is cluster table.
Can you please suggest me any other process to fetch data from cluster table. I am using native sql to fetch data.
Regards,
SURYA
Edited by: Suhas Saha on Jun 29, 2011 1:51 PMHi Subhas,
As per your suggestion I am now using normal SQL statement to select data from BSET but it is still taking much time.
My SQL statement is :
SELECT BELNR
GJAHR
BUZEI
MWSKZ
HWBAS
KSCHL
KNUMH FROM BSET INTO CORRESPONDING FIELDS OF TABLE IT_BSET
FOR ALL ENTRIES IN IT_BKPF
WHERE BELNR = IT_BKPF-BELNR
AND BUKRS = IT_BKPF-BUKRS.
<Added code tags>
Can you suggest me anymore?
Regards,
SURYA
Edited by: Suhas Saha on Jun 29, 2011 4:16 PM -
Data aquisition from spectrophotometer in two analog channels, X-Y plot
Dear colleagues!
I am new to LabView and I am only starting to learn the system (I have never been a programmer, I'm a chemist to be precise).
I have before me a task to interface an old analog scanning spectrophotometer to PC via LabView.
It has two output analog channels: one is wavelength (two ranges, currenlty let it be 190 to 390 nm; it reads on multimeter as 0.19-0.39 V range) and another one is absorbance (0-1V range). An UV spectrum sholud be an X-Y graph wherein X is wavelength and Y is absorbance.
I am able to read one channel OR another. I am able to read BOTH channels simultaneously, but how can I plot them AGAINST each other, not against TIME?
I am using DAQPad-1200 (LPT interface) and LabView 6.1 (that's why I am unable to read most of the VI's posted on the forum ).
Is such an interfacing even possible given my software and hardware limitations???
Thank you all in advance!Thanks a lot, johnsold!
I am now able to get something which looks like an UV spectrum! %)
1. I will post an image (later); however, my primary objective is to get two columns of numbers, not necessary to see an X-Y graph onscreen.
2. Without inserting arrays like I did LV always tells about error connecting this data line from two channels to save "2-D data to file" option telling me that input is 1D!
3. I have a manual for the device, it has all of the schematics. I am no electrician though. I will post scanned circuit diagrams then when I manage to scan them.
Now I see two more opportunities to control the device.
A. There is a circuit (+12V DC) on the rear of one of the modlues, which, if shorted for at least 500 milliseconds (according to Tracor manual) can initialize automatic scan. How can this be done using Labview and DAQ device? My first guess is to use an analog output and some kind of a relay, either electromagentic or semiconductor one. Is there any other possibility?
B. In my code I am always asked to write to a file after I initialize the sequence. Can this be done AFTER the sequence is finished?
C. Finally, is it possible to automatically stop the While loop when the number generated by shift register becomes equal to 190?
Here are attached a new code and a sample of data.
Attachments:
Tracor970A-v1.0.vi 53 KB
UV-test-01.txt 15 KB -
Import data from cluster table to internal table ?
Hi
My Cluster table is Zcar_00 .
I have 2 tables for zcar_00 . Name is zcar_01 and zcar_02 .
zcar_01 values :
VARKEY PAGENO MAKE
V1 1 OPEL
V2 2 BMW
V3 3 AUDI
zcar_02 values :
VARKEY PAGENO MARKA MODEL
V1 1 OPEL ASTRA
V1 1 OPEL CORSA
V1 1 OPEL VCTRA
V2 2 BMW 116
V2 2 BMW 316
V3 3 AUDI A6
I want to read data in this cluster table (zcar_01 , z_car02 ) .
My code is :
IMPORT ITAB TO JTAB FROM DATABASE zaraba_00 (*error* ) ID 'MARKA'.
How can I do ?
thanks for reply ..
serkannHi,
Go through the following code.
TYPES:
BEGIN OF tab,
col1 TYPE i,
col2 TYPE i,
END OF tab.
DATA:
wa_indx TYPE indx,
wa_itab TYPE tab,
cl TYPE mandt VALUE '100',
itab TYPE STANDARD TABLE OF tab.
IMPORT tab = itab FROM DATABASE indx(xy) TO wa_indx CLIENT cl ID 'TABLE'.
WRITE: wa_indx-aedat, wa_indx-usera, wa_indx-pgmid.
ULINE.
LOOP AT itab INTO wa_itab.
WRITE: / wa_itab-col1, wa_itab-col2.
ENDLOOP. -
Dear all:
I want to write VB programs to sample data simultaneously from two channels in PCI 5922. The niscope driver has some example VB programs to sample data from one channel, for example, the "save to file ", the program works well to sample the data from one channel. When I modify it to sample data simultaneously from two channels, I always get error so I seek your help on how to write the program to sample two channels simulatenously. Thanks. I attached the sample program here and what I tried to modify is the "channel name" and "waveform()"
Regards
Andy
Attachments:
savetofile.doc 42 KBHi Bajaf, regarding the FFT of the four channels, the next link might be what your looking for:
http://digital.ni.com/public.nsf/allkb/862567530005f09c8625671b00739970
Respect the phase issue how are you doing the acquisition of the signals, are you doing two independent acquisitions? if you are controlling them as independent acquisitions try to synchronize them with triggers and the clock.
How much are they out of phase?
By the way we know have forums in Spanish
Best Regards
Benjamin C
Senior Systems Engineer // CLA // CLED // CTD -
How to select data from cluster table
hi experts,
I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
please advice.
maniHi Manikandan,
The following code may be helpful to understand how to select the data from cluster table.
Types: Begin of ty_kna1,
Kunnr type kna1-kunnr,
adrnr type kna1-adrnr,
end of ty_kna1,
begin of ty_bseg,
belnr type bseg-belnr,
kunnr type bseg-kunnr,
end of ty_bseg,
begin of ty_final,
belnr type bseg-belnr,
kunnr type kna1-kunnr,
adrnr type kna1-adrnr,
end of ty_final.
Data: it_kna1 type table of ty_kna1,
wa_kna1 type ty_kna1,
it_bseg type table of ty_bseg,
wa_bseg type ty_bseg,
it_final type table of ty_final,
wa_final type ty_final.
Select kunnr adrnr from kna1 into table it_kna1 where....
if sy-subrc = 0.
select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
endif.
sort it_kna1 by kunnr.
Loop at it_bseg into wa_bseg.
move wa_bseg-belnr to wa_final-belnr.
read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
if sy-subrc = 0.
move: wa_kna1-kunnr to wa_final-kunnr,
wa_kna1-belnr to wa_final-belnr.
endif.
append wa_final to it_final.
clear wa_final.
endloop.
Loop at it_final into wa_final.
write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
endloop.
Reward if useful.
Thankyou,
Regards. -
Hi,
I am importing data from cluster PCL2, RT table for Indonesia country code is 34 and RELID is IS.
The amount which i am getting in RT table is coming wrong. For Eg - 40,00,000 is coming as 40,000.
Please help.
Thanks in advancesolved
-
Hi,
I met a problem.
How to read data from cluster tables using:
b2-key-pernr = 20.
b2-key-pabrj = 2006.
b2-key-pabrp = 09.
b2-key-cltyp = '1'.
import saldo from database pcl2(b2) id b2-key.
the problem is that the sy-subrc is always 4, could anyone help me?
thank you very much!Hi,
Import and export to database is used in two programs and not in the same program.
<b>ZPROGRAM1.</b>
tables : indx.
Data : SALDO type i,
indxkey LIKE indx-srtfd VALUE 'ZAB1'.
indx-aedat = sy-datum.
indx-usera = sy-uname.
indx-pgmid = sy-repid.
EXPORT SALDO TO DATABASE indx(zc) ID indxkey.
In another program,
<b>ZPROGRAM2.</b>
tables : indx.
Data : SALDO type i,
indxkey LIKE indx-srtfd VALUE 'ZAB1'.
indx-aedat = sy-datum.
indx-usera = sy-uname.
indx-pgmid = sy-repid.
IMPORT SALDO FROM DATABASE indx(zc) ID indxkey.
Best regards,
Prashant -
Retrieve data from cluster tables
hi
can any one explain me how to retrieve data from cluster tables
Regards
sachinyou can write a select
select * from KONV
into table it_konv
where <condition>
you cant join.. cluster tables.. -
How to fetch data from cluster tables
hi
i need to know how to fetch data from cluster tables please update me if any
i know that we cannot use joins in cluster table we use view etc
but i need detailed inforation on methods for fetching data from cluster tables
regards
NishantHi,
Check the following links
http://fuller.mit.edu/hr/cluster_tables.html
The specified item was not found.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33 -
How to access data from Cluster table....?
Hi Experts,
Can You plz tell How to import/read data from cluster table? Plz give me the syntaxes also..
Thanx in advance.Types of TABLES and the differences
Transparent tables
Pool tables
Cluster Tables
From the user point of view, all tables are used to store data and there is no difference in behavior or operation of these tables. All of them can be managed by using the standard OPEN SQL. However from the administrator point of view, transparent tables do exists with the same structure both in the directory as well as the database, exactly with the same data and fields. While other two are not transparent in the sense that they are not manageable directly using database system tools. We cannot use Native SQL statements on these tables. These are logical tables, which are arranged as records of transparent tables.
Maybe you are looking for
-
Issue in maintaining Long Text in Message Class
Hi For Note implementation 1413492, I have to maintain long text, when I click on Long Text , I get a pop-up Create Modification , with 2 options for Template Type (1) Original Text (2) Template (With Headers) Can anyone let me know how to proceed fu
-
I am starting a new iPhoto library on a new iMac. I've never had this issue on my other Mac's but places takes forever to locate (I've used this a lot before with no problem). Just a spinning gear. The pin won't drop and where there is a pin, I canno
-
Working on installation of new imac 20 dual core intel. Have transferred user files, folders, applications and network settings via firewire. During software updates, received spinning ball of death multiple times. After restarting software updates,
-
I was unable to install the 35.1 mb itunes program after downloading it- I'd click, nothing would happen at all. No error messages or anything. So I decided to try downloading and installing each portion (itunes and quicktime) separately. Okay, I hav
-
Stop the Billing Doc creation for error confirmation
Hello Experts, This is regarding the Billing issue. Our Service Process: We create the Service Process and also create the followup confirmations. For ex: I have created one SP and also created one followup two confirmations. The second Confirmation