cancel
Showing results for 
Search instead for 
Did you mean: 

Review

SOLVED
ali9963
Member
Solved!

Review

Message contains an attachment

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

17 REPLIES 17
Gregory
Trusted Enthusiast

Re: Review

Message contains a hyperlink

Hi Ali,

 

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

altenbach
Knight of NI

Re: Review

  • 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. Smiley Very Happy 

altenbach
Knight of NI

Re: Review

Message contains an attachment

@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.

 

 

jamiva
Active Participant
Solution

Re: Review

Message contains an image Message contains an attachment

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

altenbach
Knight of NI

Re: Review

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

altenbach
Knight of NI

Re: Review

Message contains an image Message contains an attachment

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

 

 

ali9963
Member

Re: Review

can you save to 2014 and resend i back

altenbach
Knight of NI

Re: Review

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

jamiva
Active Participant

Re: Review

Message contains an image

@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