Go to Post FIRST- its a pandemic in all our schools. - Akash Rastogi [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 19-12-2009, 08:47
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,751
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: DO write speed

The updates to that module happen at around 7microseconds. Other digital modules that don't have individually addressable and directional pins update much faster, but that particular digital module is less expensive, flexible, and a bit slow. 7us is the speed you can accomplish if the FPGA updates the values with FPGA logic, or if the cpu updates a register on the FPGA map fast enough. I suspect that the layers of function calls and some value checking are what is adding the overhead you are seeing. You certainly know your way around LV, so feel free to drill down into the digital subVIs. Test each time you get to a new layer and you'll get a feel for where the overhead is. Please ask questions if something doesn't make sense or if you make some good discoveries.

You may also consider using the PWM I/O functions. I believe that will more easily produce the tones you want because it will be the FPGA doing the high speed switching.

I wanted to comment on one of the other posts.
Quote:
Originally Posted by daltore View Post
Basically, there are just a lot of layers in the FRC control setup. LabView is an interpreted language running on firmware on the cRio itself. The firmware (an interpreter) reads the compiled LabView code and figures out what it wants the cRio to do. That interpretation takes time...
Some of the other things in the reply were essentially the same as Eric and I are saying, that it is SW layers adding overhead. But just to nip the interpreted thing in the bud, LV is a compiled language and has been for over twenty years. The LV diagram is turned into PPC instructions that are executed directly by the CPU. I believe the firmware you are referring to is the VxWorks OS, and it is not interpreted either. It is native code based on C/C++. In a LV app, there is no interpreting unless you write one.

You may have been thinking of the NXT execution system. I'll be happy to go into more details or answer any questions you may have.

Greg McKaskle
Reply With Quote
  #2   Spotlight this post!  
Unread 19-12-2009, 22:58
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: DO write speed

Quote:
Originally Posted by Greg McKaskle View Post
You may have been thinking of the NXT execution system.
Well, that's nice to know. I was just going off of the fact that it runs interpreted on our computers and on the NXT bricks, so it's good to know that they've got it running directly on their own hardware. I thought the compilation process was just to put it in a lower-level interpreted language, so I'm glad it's actually compiling it into machine language.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-12-2009, 10:00
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,751
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: DO write speed

Glad to help clear things up. But I'm curious why you say that it runs interpreted on your computers. Do you mean the PC? For that LV generates native x86 instructions. Basically, it LV targets a platform it generates native code. The exceptions are the NXT where it runs on a VM similar to Java, and for embedded tools where we generate C code and run the C code through vendor tools for generating native code. I suppose the FPGA counts as an exception as well since we generate VHDL and that trudges through the native tools to become an optimized fabric for the FPGA.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 20-12-2009, 20:13
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: DO write speed

Okay, I got something about 10 times as fast.
It was locked, else I might have dug deeper. (though I suspect this may be as far as the processor goes)
I have some questions about *why* it is done this way.
It looks like it actually updates all 14 GPIO at the same time. Is this how the module is normally accessed? I ran the channel mapping VI on my computer, and found that the bit placement directly corresponds to the channel number on the DIO module.
What separates these updates from the PWM and relay updates? Is this just an efficient way of passing the data to the Digital Module?

Would it be faster sending a string of data through I2C?
Attached Files
File Type: vi signal generator 2.vi (27.6 KB, 20 views)
__________________
-- Marshal Horn
Reply With Quote
  #5   Spotlight this post!  
Unread 21-12-2009, 01:05
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: DO write speed

Quote:
Originally Posted by kamocat View Post
It looks like it actually updates all 14 GPIO at the same time. Is this how the module is normally accessed?
First of all, nice job on speeding it up, it's not always easy. But this is how it's usually done on microcontrollers, I'm not sure if it's the same way on the FPGA. But at least in micros, values are updated an entire register at a time, and it does not impact speed. Basically, the microcontroller is designed in such a way that it tells the port register what ALL of its values are in parallel (for speed), and it updates all 8 pins on the register almost simultaneously.

This is mainly for parallel communication, where you need to update all of the bits in the byte you're trying to send at the same time so you can tell the receiving end of the line when it can look for the new data. It's kind of just a precedent, and they've probably put that into the update protocols of the digital module itself (cRIO communicates to the digital module over a serial connection, that VGA-sized port at the bottom, so all data extraction is done inside the module).

This is all just inferences from working with other microcontrollers, and I know that the cRIO is a completely different animal, but the precedents probably still stand. I'm going to guess that the GPIO bank is made up of two registers coming off of the chip inside the digital module, which would kind of act like a "middle-man". If anyone here knows the actual construction of the cRIO modules, I would love to hear about it.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-12-2009, 02:12
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: DO write speed

Its not just for parallel communication. It is a side effect of the fact that figuring out what to do is often harder than doing it. In designing a microprocessor, it is just as easy to have it update N* pins as it is to only update one. You might as well take advantage.

For serial devices like the cRIO module, it is often quicker to update them all so you don't have to do any addressing. For example, the relay pins on the DSC do just this. We send a reset signal and then clock every single pin out every time. The whole process takes on the order of N+4 clock cycles. If we were to do individual pin addressing, we'd have to clock out the address and then the pin value, which would be on the order of log2(N)+5 per pin. This would be quicker for one or two pins, but loses in a hurry if we are updating many pins.

Note that CAN is taking the opposite strategy: Since there are so many more registers to talk to, the overhead of addressing what you are talking to is worthwhile.


* If N is equal to or less than the width of the processor
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
pic: Write in Kamen? I did. joshsmithers Extra Discussion 10 05-05-2008 17:17
Write Mac Floppies on a PC? sanddrag IT / Communications 13 26-09-2004 22:07
read/write EEPROM on 18F8520 WizardOfAz Programming 39 22-03-2004 13:32
What program should I write? rbayer Programming 24 03-10-2003 20:07
Write letters Todd Derbyshire Rumor Mill 1 16-02-2002 02:19


All times are GMT -5. The time now is 11:52.

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