Jump to content

Hello I need help with data table


Recommended Posts

I tried to set up two separate tables, both with time and date strings.
In my project I need to show the time and date when I start the process and also the time and date at the end of the process.
I used the help and examples and got far but it doesn't work correctly.
It would be nice if, for example, if the process does not start, the windows appear empty and as soon as it starts the time and day appear and only at the end the end time and date appear.
I wasted hours on the project and it's difficult to understand the purpose of the tables
I greatly appreciate your help.
I speak English because I'm from Brazil and I use a translator

image.png.239840304ae4cd8206105b847875b994.png

image.png.ecc72c4caa402ecd2ee40a61465ff030.png

 

Link to comment
Share on other sites

  • MVP 2022

Unless you are keeping a log of all the recent start & stop times, you don't need to use Data Tables. Just store the start & stop times in MI vectors as a string using the RTC To ASCII FB. Then you can display the string or clear it out as desired.

If you are keeping a log, then create a Data Table with 2 columns of String property and store the Date & Time at the appropriate moment with a Write Row FB. It's easy to keep the most recent value at the top of the Data Table with the Copy Rows function to copy all the rows down 1 either just before or just after your write.

Link to comment
Share on other sites

On 21/10/2023 at 22:09, Flex727 said:

Manter um registro seria mais ou menos assim:

imagem.png.ded478a88e47e228e9bd1daae02c1de3.png

Para exibir os dados, use a linha de cópia para o vetor FB e exiba os endereços apropriados para os vetores.

hello flex the data table write row 1 and 2 have different addresses

Link to comment
Share on other sites

  • MVP 2022
47 minutes ago, roghenr said:

hello flex the data table write row 1 and 2 have different addresses

I don't know what you mean by this. There is no problem with using multiple Data Table Write Row FBs, or having multiple Data Tables if it's easier.

Link to comment
Share on other sites

1 hour ago, Flex727 said:

Não sei o que você quer dizer com isso. Não há problema em usar vários FBs de linha de gravação de tabela de dados ou em ter várias tabelas de dados, se for mais fácil.

 

1 hour ago, Flex727 said:

Não sei o que você quer dizer com isso. Não há problema em usar vários FBs de linha de gravação de tabela de dados ou em ter várias tabelas de dados, se for mais fácil.

Good afternoon, I'll show you what I'm doing

Link to comment
Share on other sites

58 minutes ago, Flex727 said:

All of that in the last message looked exactly right to me. What problem remains?

Flex I will redo it as you showed

# only record the beginning
time and date

 

writes every time pulse key updates line zero

image.png.180f970032e274fb3e4e410a37998cfe.png

 

but it doesn't update string

image.png.98116da0973226a650cd045811d8e346.png

 

image.png.a96b395252d26300b8a3c42b97add2b0.png

image.png.50d473da37e67d243b3821b4eba111f3.png

 

image.png.8fe8ee3880e778f987cc60551b5f69e1.png

know time is short but if you can help I would be grateful.
I tried some examples, watched videos and it even worked, but not as it should.
I'm kind of lost in addressing the write and read blocks in relation to reading the time and date clock

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

On 01/10/2023 at 18:43, kratmel said:

Crie uma variável de temporizador na tela e selecione a opção necessária.

Temporizador_V130.jpg.9140d835ef6c8f958dffe790751d7b4d.jpg

 

 

5 hours ago, Flex727 said:

Não sei o que você quer dizer com isso. Não há problema em usar vários FBs de linha de gravação de tabela de dados ou em ter várias tabelas de dados, se for mais fácil.

I initially did as you showed me to continue development

image.png.c597453b4a3655c8a32d30d4be2cafc3.png

 

image.png.9c30e517a2f80a314201ad0d7c2aace8.png

 

Now I need to show finalized date and time values only when this occurs.
It could show dashes, figure or nothing or maybe show zeros

Link to comment
Share on other sites

  • MVP 2022
1 hour ago, roghenr said:

image.png.c597453b4a3655c8a32d30d4be2cafc3.png

No, MB 174 & MB 312 go in front of the Data Table Write Row FB. The RTC To ASCII FBs can just hang on the left rail to execute on every PLC scan.

Attach your program file here and I'll look at it. Also, describe exactly what it is you want the program to do - something like: I would like to record the start & stop times for the last 10 events and display the most recent (or selected) event on the screen.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...