4D Visi / Visi Genie Component

Forum for Flowcode v6 beta users

Moderator: Benj

Locked
User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

4D Visi / Visi Genie Component

Post by Benj »

Hello,

Here is an updated component to allow the 4D systems Visi interface to function from a PC connected via a 4D USB2Serial cable or via a Embedded microcontroller device.

The component will be included in the next patchset (3) so until this is released you will need to copy the .fcpx file into the "Flowcode v6 Beta/Components" directory before loading any of the example files.

Let me know how you get on. The examples use rockerswitches but all the other Visi components should work in the same way.

The first example shows how to wait for incoming reports with two LEDs on the dashboard panel to represent the state of the switches.

The second example demonstrates adding control to allow you to control one of the switches from either the display or the PC/Embedded device.

The console window is very useful during simulation so please remember to open this up and have a look at the Visi and Data bytes tabs. You can view them side by side by right clicking and adding a new tab group.

When calling the readobject or writeobject macros there is a drop down menu next to the ObjectID which provides all the Objects as constants. These can also be referred to in decisions if need be.

Let me know if I have missed any tricks or if there are any bugs and I will get them fixed.
Visi.zip
(121.05 KiB) Downloaded 455 times
Be sure the COM port is selected correctly for your device, if you still have the 4D serial interface open in the 4D software then Flowcode will be unable to see the channel and connect.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

I have tried to program my pic16f877A with your rockerswitch example but it gives me this error:
Visierror2.png
(10.6 KiB) Downloaded 8499 times
Do you have any idea what might be causing this because the leads in the board are all in the same place and I haven't really touched anything..

P.S. I have tried the console window and opened up another tab but if you set the tabs that you want to view as soon as you start the simulation they change to the default is this supposed to happen ?


Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

I have just opened the rockerswitch2 demo and tried programming with that and the same result, Invalid Device, so I am going to try something in FC5 to see if it is the programmer or chip, also when I opened the console in this chart there was no visi tab.

Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

Ok I have got over that disaster, a faulty PGD lead me thinks, so I have now successfully programmed the 877A with the rockerswitch demo however it is still not working so I am going to check to see if I am using the correct TX & RX on the display.

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

Fantastic, It is running now, I have also tested the 4D Workshop file of mine and can say that the EVENTS on the switches must be REPORT MESSAGE.

I have taken a video of it here: http://www.youtube.com/watch?v=dGk9GqAv ... ERnCxvQamQ



Also I will enclose the working 4DW file if anybody else wants to try this.

Thank You So Much Benj Your Efforts Are Greatly Appreciated *
Acestu
Visi4DW.rar
(1013 Bytes) Downloaded 476 times
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

Now that I have completed the "On OFF" switch test for the Visi component, I would like to try a simple slider project and capture the "On Change" and "On Changing" data, do you have any example charts of this please.

Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by Benj »

Hi Stu,

Should be exactly the same but the ObjectID will be different and the data will be 0-?? instead of 0 or 1. If you output the value to a display then you can see what value is being returned. Glad the embedded side is also working correctly I only tested the sim interface but both should work equally well (it's basically the same code just pointed at different interfaces - CAL UART or COM Port)

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

Could I just ask you please what these two lines are in the "Read Byte From Message"

3 = value MSB

4 = value LSB


What is the MSB & LSB ?


Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

This pic makes remembering the Object ID's easy:
Object-Summary.png
(44.87 KiB) Downloaded 8476 times
So the Object ID and the Object Index are simple really, I just need to know more about 1,command 3,valueMSB 4,valueLSB

P.S. Couuld you also tell me what this calculation is saying please:
calculation.png
(3.42 KiB) Downloaded 8455 times


Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by Benj »

Hi Stu,

The command is 7 for an incoming report and there is another option which I can't remember.

The data high and data low is combined together into the 16-bit data variable. For a switch this is 0 to 1. For other more analogue Visi components the value will be allowed to go much higher, max 0 to 65535. This is what the calculation is doing.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

I have modified your Visi-Demo chart to show the data from the display on the screen here:

http://www.youtube.com/watch?v=diP0ndGp ... ERnCxvQamQ

However because the data goes to 100 on the slider the video looks fine but if you turn the slider right up to 100 the last digit 0 stays on the display and it looks as if you are getting data readings in the 3 figure range, I have tried a few different ways to prevent this but not had very good results, any tips would be appreciated, I am posting the chart with this post..

cheers
Acestu
SliderDemo.fcfx
(14.24 KiB) Downloaded 405 times
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by Benj »

Hi Stu,
However because the data goes to 100 on the slider the video looks fine but if you turn the slider right up to 100 the last digit 0 stays on the display and it looks as if you are getting data readings in the 3 figure range
The previous number is not being cleared if the digit count drops from 3 to 2 and again from 2 to 1. You can get around this by first printing a string in the same location with three spaces to ensure all three characters always get reset.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: 4D Visi / Visi Genie Component

Post by acestu »

Hi Benj,

Thanks for the tip, I put the 3 spaces in and it worked like a charm.... :D
SliderDemo.fcfx
(14.54 KiB) Downloaded 405 times
Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Locked