Go to Post ...too much to do... ...too little time... - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2013, 18:48
wolfeman wolfeman is offline
Mentor, Team 2590
FRC #2590 (Nemesis)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: NJ
Posts: 19
wolfeman is an unknown quantity at this point
Schrödinger's Analog Trigger?

I'm trying to use the AS5030 rotary magnetic encoder from Austria Microsystems.
I have it wired for the sin/cos outputs cause I want to use it measure RPMs
off a CIM. There are no bundled Labview examples of using the AS5030. There's
an exmaple here in CD using it in SPI mode, not analog sin/cos. A team
did post an example over at ni.com and I started with that example:

https://decibel.ni.com/content/servl...nd%20Motor.zip

The full post starts here:

https://decibel.ni.com/content/thread/11955

When I try this example, it fails right from the getgo at WPI_AnalogTriggerOpen.vi.
THe error is:

Error -63195 occurred at Read/Write Control in
FPGA_AnalogTriggerWriteUpperLimit.vi->WPI_AnalogTriggerOpen.vi->Magnetic Encoder with Motor v2.vi

Possible reason(s):

NI-RIO: (Hex 0xFFFF0925) The handle for device communication is invalid or has been closed.
Restart the application.

It's FPGA_AnalogTriggerWriteUpperLimit.vi that is emitted the error.
I went into Analog Trigger Open and turned on highlight execution to see
what I could see... With highlight execution enabled it all works!! Consistently!
So it only works when you are watching...
I've attached a picture and of the execution path when it works (highlight execution enabled)

So I'm guessing it's a race condition somewhere in the libraries. Are
other folks seeing this issue? Is there a fix or a workaround? What is the right
vehicle for reporting WPI library bugs?

Thanks,

Pete, Team 2590
Attached Thumbnails
Click image for larger version

Name:	WPA_AnalogTriggerOpen.vi..PNG
Views:	59
Size:	76.1 KB
ID:	13674  
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2013, 19:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Schrödinger's Analog Trigger?

I think you have found a minor bug that was introduced in the analog triggers. Since they aren't used very often, it looks like it was overlooked in the beta program.

The issue is that this Open seems to be taking place in Begin before the FPGA refnum is valid. The Open tries to access the FPGA and doesn't ensure that it is loaded and stored first.

If you want to work around it to control the race condition, wire the Error Out of the RobotDrive or other blocks into the AnalogTrigger Error in. This will sequence the Trigger Open later and avoid the issue. This will be fixed in the next update.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2013, 19:36
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Schrödinger's Analog Trigger?

Quote:
Originally Posted by Greg McKaskle View Post
The issue is that this Open seems to be taking place in Begin before the FPGA refnum is valid. The Open tries to access the FPGA and doesn't ensure that it is loaded and stored first.
Wouldn't one typically open the Analog Trigger based on a refnum from an already-opened Analog Input? That would keep the problem from showing up in an actual application. It only fails because the example is "constructing" a refnum without really opening the resource it refers to.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2013, 08:12
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Schrödinger's Analog Trigger?

Sounds right Alan. Probably explains it.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2013, 13:42
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Schrödinger's Analog Trigger?

FYI, There is an example built into LabVIEW for the AS5030 using the analog output. It's called Magnetic Encoder with Motor.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi