LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED not changing immediately?

Solved!
Go to solution

Hi! I currently have an assignment that requires me to create a security system, which is almost the same as this video. Around the 29:30 min mark, you can see the LED change colours immediately when he clicks the buttons.

 

I followed what he did in the block diagram but couldn't replicate his results. What might be the problem here?

 

I'm thinking its because every time it loops, TCP read has to wait for TCP write to send data to it hence the delay, but if this was the case, wouldn't the video also have the delay too?

image.png

0 Kudos
Message 1 of 8
(672 Views)

@koga3z wrote:

you can see the LED change colours immediately when he clicks the buttons.

 

I followed what he did in the block diagram but couldn't replicate his results. What might be the problem here?

 

I'm thinking its because every time it loops, TCP read has to wait for TCP write to send data to it hence the delay, but if this was the case, wouldn't the video also have the delay too?

 


Yes, the TCP Read will wait, but I don't see significant delays (well, you have 100 ms sleeps, but no larger delays noticed), this is how it works for me:

changes.gif

0 Kudos
Message 2 of 8
(660 Views)

@Andrey_Dmitriev wrote:

@koga3z wrote:

you can see the LED change colours immediately when he clicks the buttons.

 

I followed what he did in the block diagram but couldn't replicate his results. What might be the problem here?

 

I'm thinking its because every time it loops, TCP read has to wait for TCP write to send data to it hence the delay, but if this was the case, wouldn't the video also have the delay too?

 


Yes, the TCP Read will wait, but I don't see significant delays (well, you have 100 ms sleeps, but no larger delays noticed), this is how it works for me:

changes.gif



Hmm, that is weird. Do you have any idea what might cause a delay of up to 5 seconds on my side?

 

It was working normally yesterday, but now the thing just... I don't know what to say about this.

0 Kudos
Message 3 of 8
(654 Views)
Solution
Accepted by topic author koga3z

@koga3z wrote:

 

It was working normally yesterday, but now the thing just... I don't know what to say about this.


As stupid suggestion - may be you have highlight execution active on BD?

Screenshot 2024-02-28 15.56.15.png

0 Kudos
Message 4 of 8
(645 Views)

Hey Andrey,

 

I just found out the reason why there's a delay on my side, it's because I had the block diagram on while running my front panel, causing the huge delay...

 

Thanks for your help anyways 🙂

0 Kudos
Message 5 of 8
(638 Views)

@Andrey_Dmitriev wrote:

 

As stupid suggestion - may be you have highlight execution active on BD?

Screenshot 2024-02-28 15.56.15.png


Did some more "debugging" around, and I found out it was this thing's problem! TIL haha... Will keep it in mind next time

0 Kudos
Message 6 of 8
(628 Views)

For some general comments here are some potential simplifications.

 

  • You can use a colorbox (can be made to look like an LED!) Where the color is the data. No properties needed!
  • Interpreting three booleans as binary integer does NOT need anything orange and definitely not a case structure with 8 cases!
  • In your lower case structure, you have many duplicate cases that could be combined and if you would place the terminals before the case structure, you would not need any local variables at all. Most likely all you need are diagram constant.
  • etc. etc.,

 

altenbach_0-1709147227827.png

 

Note that (for simplicity) I replace the TCP with a simple notifier, retaining the string type as message. I would strongly recommend to use UDP instead of TCP. A stateless connection is much less overhead!

 

0 Kudos
Message 7 of 8
(572 Views)

@altenbach wrote:

 I would strongly recommend to use UDP instead of TCP. A stateless connection is much less overhead!

 


Here's how that could look like....

(Of course typically the two loops would run on different machines (else we would not need any network protocol!) and changes need to be made. Have a look at the UDP example in the example finder.)

 

altenbach_0-1709148082122.png

 

 

0 Kudos
Message 8 of 8
(564 Views)