LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Review

Solved!
Go to solution

Hi All,

Can anyone review my code and tell whether it is right or wrong.

And in the second Vi can anyone modify it?

 

Please find the attached requirement doc

Regards,

Ali

Download All
0 Kudos
Message 1 of 18
(4,127 Views)

Hi Ali,

 

Yes, I know many people who would be interested in doing that: JKI, Viewpoint, Bloomy, Averna

0 Kudos
Message 2 of 18
(4,107 Views)
  • Do not name VIs with ".." before the file extension
  • How are the VIs you have attached related to the problem?
  • Your VIs containing missing subVIs.

Your VIs are "right" if they produce the desired result for any defined input. You can check that yourself. No need to ask here. Does you code give the expected result? If not, in what way is it wrong (all wrong, sometimes wrong, partially right, computer crashes, etc.)

 

Once you have a working version, we will be happy to help and show you how the same thing can be done with 10% of the code. 😄 

0 Kudos
Message 3 of 18
(4,077 Views)

@ali9963 wrote:

 

And in the second Vi can anyone modify it?

 


Here is a modified second VI. Since you did not tell us how to modify it, I made some guesses.

 

 

Message 4 of 18
(4,071 Views)
Solution
Accepted by topic author ali9963

You didn't include the "subset.vi", but I can tell you your "1.vi" will not work.

 

4bytes x U8 is 32bits. You are converting the 32 bits of information BEFORE you wire it to the "subset.vi". You are always sending the same bottom 8 bits.

 

Not sure if its the best way, but this is one way to do it. I converted the 4 bytes into a U32 integer. Then mask the bits that are needed, then shift them out of the U32 to get the next set of bits ready for the next iteration.

 

Get Date_Time.png

0 Kudos
Message 5 of 18
(4,063 Views)

Why not typecast the U8 array directly to a U32 scalar? No need to go pink first. 😄

Message 6 of 18
(4,058 Views)

Instead of all that duplicate code, here's how I would parse the Date Code (note that the MSB is not used, so we can do all in I32. Makes the later +/- adjustments easier). I also would do a cluster output: self documenting, a single output connector, etc. You can always unbundle whatever you need later. (If you think you need more connectors than the default connector pane, something is wrong It also makes no sense to create output arrays (instead of scalars) for each field!!)

 

(Disclaimer: Not fully tested. Please verify correct operation. There might be bugs)

 

ParseDSPDateCode.png

 

 

Message 7 of 18
(4,044 Views)

can you save to 2014 and resend i back

0 Kudos
Message 8 of 18
(4,017 Views)

Your VIs were LabVIEW 2015. Why do you need version 2014?

0 Kudos
Message 9 of 18
(4,004 Views)

@altenbach wrote:

(Disclaimer: Not fully tested. Please verify correct operation. There might be bugs) 


ali996

One minor bug I see is seconds is 2 x sssss

 

DateCode.PNG

Message 10 of 18
(3,984 Views)