EDIT:
forget this post
see the next post.
or this link
enc28J60 ( may 2016 )
the enc28J60 compo is updated long time ago
*********
hi guys
if you want to set the ip in compile time before a enc28j60_init() is done
you can use the properties from enc28j60 to set it by edit the textlines.
if you want to save this in Vars for a Backup in eeprom, then you can
use the EV_compile and save the Ip's setting in your Project Vars.
if you want to set the ip in runtime mode before init the enc28j60 in code
then you can use the write and read register doings for init
and call only the things what you need then byself.
if you want to set the ip like beni sayed, like i have understand ( language translate )
not sure, but think we need a Var "Server IP" update
or he means the things like on top
descripted.
@roy:
see in the vba example, how the port is done.
go to panel properties and you see a server port 255
this var is then use for the check
"CheckForTCPPort"
and is defined in the code with (FCM ups..sorry must be FCV
but it was a example.. )
Code: Select all
#define FCV_00000_panel__FCM_SERVERPORT (255)
and this var you use then with
"CheckForTCPPort" and answere it if match..
btw:
Code: Select all
MX_GLOBAL MX_UINT8 FCV_XXXX_TCPIP_ENC28J60__BUFFER[FCVsz_XXXX_TCPIP_ENC28J60__BUFFER
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__MakeArpRequest(MX_UINT8 *FCL_SERVERIP, MX_UINT16 FCLsz_SERVERIP)
is your friend.
btw, do a view c
and see the other macros, that are not listed in the icon
but still there, you can follow the instruction for a setup the enc28j60
start with
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__Initialise();
and follow the instruction, what this function call.
then you find the setup procdure for IP and MAC..
IP Code:
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__IpMakeIp()
{
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1E] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1A];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1F] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1B];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x20] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1C];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x21] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1D];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1A] = 192; ///< ? FCV_MyIpVar0
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1B] = 168; ///< ? FCV_MyIpVar1
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1C] = 0; ///< ? FCV_MyIpVar2
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x1D] = 90; ///< ? FCV_MyIpVar3
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x14] = 0x40;
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x15] = 0;
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x12] = FCV_XXXX_TCPIP_ENC28J60__IP_IDENTIFIER >> 8;
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0x13] = FCV_XXXX_TCPIP_ENC28J60__IP_IDENTIFIER;
FCV_XXXX_TCPIP_ENC28J60__IP_IDENTIFIER = FCV_XXXX_TCPIP_ENC28J60__IP_IDENTIFIER + 1;
FCD_XXXX_TCPIP_ENC28J60__IpFillIpHdrChecksum();
}
MAC Code:
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__IpMakeEth()
{
FCV_XXXX_TCPIP_ENC28J60__BUFFER[0] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[6];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[1] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[7];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[2] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[8];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[3] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[9];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[4] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[10];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[5] = FCV_XXXX_TCPIP_ENC28J60__BUFFER[11];
FCV_XXXX_TCPIP_ENC28J60__BUFFER[6] = 100; /// < ? FCV_MyMAC0
FCV_XXXX_TCPIP_ENC28J60__BUFFER[7] = 101; /// < ? FCV_MyMAC1
FCV_XXXX_TCPIP_ENC28J60__BUFFER[8] = 102; /// < ? FCV_MyMAC2
FCV_XXXX_TCPIP_ENC28J60__BUFFER[9] = 103; /// < ? FCV_MyMAC3
FCV_XXXX_TCPIP_ENC28J60__BUFFER[10] = 104; /// < ? FCV_MyMAC4
FCV_XXXX_TCPIP_ENC28J60__BUFFER[11] = 105; /// < ? FCV_MyMAC5
}
what to do is,
create IP vars for the
BUFFER[1E] / BUFFER[1A]
BUFFER[1F] / BUFFER[1B]
BUFFER[20] / BUFFER[1C]
BUFFER[21] / BUFFER[1D]
create MAC vars for the
BUFFER[0] / BUFFER[6]
BUFFER[1] / BUFFER[7]
BUFFER[2] / BUFFER[8]
BUFFER[3] / BUFFER[9]
BUFFER[4] / BUFFER[10]
BUFFER[5] / BUFFER[11]
and do a setup/init routine with the same function and
your overrides
and call it.
or check the
Code: Select all
MX_GLOBAL MX_UINT8 FCV_XXXX_TCPIP_ENC28J60__BUFFER[FCVsz_XXXX_TCPIP_ENC28J60__BUFFER];
at begin in your code after start it and do an [idx]override simple for IP / MAC with your "Project Vars"
if you want relax situation:
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__MakeArpRequest(MX_UINT8 *FCL_SERVERIP, MX_UINT16 FCLsz_SERVERIP)
simple check your IP Vars with this.
hope this helps.
nice weekend
best wishes
rudi
request:
want a
Code: Select all
void FCD_XXXX_TCPIP_ENC28J60__Initialise( MyIP );
too