Fifo In Dbd Format

40585455

Member
Join Date
Nov 2006
Location
ans by
Posts
3
Hello guys
can anyone of you out there help me. The problem goes like this i have to make a logging of a lot of data that needs to be in real format so i cannot not use the fc85 fifo since it only supports word format.
have any of you made a fifo block for dbd use or is it already in the software.

Hope you can help me on the issue.

Kind regards - thanks in advance

Jens V. Hansen
 
Fifo Dbd

The problem is that i need the floating point and as far as i know it is not possible to use floating point in word so im kind a stuck at that solution.

Sorry for not posting the problem more accurate.

Kind regards

Jens V. Hansen

but anyway thanks for the idea
 
It is very easy to split one floating point number up into two words (I'll show you if required), how easy will it be to add two entries to the FIFO each time ?
 
Please i like to se how thats done

I will be verry pleased if you would give me an example cause what i have done so far is in stl but would like it in bloks to keep it more simple for the service of other personel in the future.

attached is the stl version

kind regards

Jens V. Hansen
 
I'm not in a position to code at present, but if you call FC85 first with a word loaded from DB10.DBW484 and then with a word loaded from DB10.DBW486 it will put two entries in the FIFO - hope that makes sense. I've not used FC85 myself but there are other examples on the forum if you search.
 
You could use two FC85 calls if it makes it easier and have two FIFO's, one for the high word and one for the low word.

You are right you cannot change a floating point to a word and use it, you can though split the data into two words to store.

Example, your floating point is held in DBD10, you could store DBW10 and DBW12 separately and when recovering, return into DBW10 and DBW12 (in the correct order of course) and use DBD10 as normal afterwards.
 
Here is my example code for a floating point version of add an entry to a FIFO. Call FC4 to add data to the FIFO - this uses FC84 (add data to table). (Note import this code to a source code folder and compile it to view the code in the block editor)

Code:
DATA_BLOCK DB 100
TITLE =
VERSION : 0.1

  STRUCT  
   FIFO : STRUCT  
	iTableLength : INT  := 200; //double the size of the real array
	iNumberOfEntries : INT ; 
	Data : ARRAY  [1 .. 100 ] OF REAL ; 
   END_STRUCT ; 
  END_STRUCT ; 
BEGIN
   FIFO.iTableLength := 200; 
   FIFO.iNumberOfEntries := 0; 
END_DATA_BLOCK

FUNCTION FC 4 :void
TITLE =Floating point FIFO
VERSION : 0.1

VAR_INPUT
  rData : REAL ; 
END_VAR
VAR_TEMP
  Data : ARRAY  [1 .. 2 ] OF WORD ; 
END_VAR
BEGIN
NETWORK
TITLE =get data and store in array
	  LAR1  P##Data; 
	  L	 #rData; 
	  T	 D [AR1,P#0.0]; 
NETWORK
TITLE =add first word
	  CALL FC84 (
		   DATA					 := #Data[1],
		   TABLE					:= DB100.DBX	0.0);
	  NOP   0; 
NETWORK
TITLE =add second word
	  CALL FC84 (
		   DATA					 := #Data[2],
		   TABLE					:= DB100.DBX	0.0);
	  NOP   0; 
END_FUNCTION
 

Similar Topics

I am not sure if this is possible but if there is a way, you guys would be the ones to know. I am currently working on a project where we are...
Replies
7
Views
288
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
1,004
Hello! I have a network of conveyors bringing raw product to 4 machines. A sensor in the hopper of each machine calls for more product. I'm...
Replies
15
Views
5,956
Hello everyone, has anyone out there ever made a FIFO using an FFL and FFU instructions on a Micro800? I have tried setting it up just as I would...
Replies
9
Views
3,172
I have a bottle capper that is using an encoder and FIFO logic to track the free standing bottles passing through a bottle capper. I have checked...
Replies
31
Views
11,774
Back
Top Bottom